Databases Flashcards
Relational Database
A database which recognises the difference between entities by creating different tables for each entity
Entity
An item of interest of which information is stored
Attributes
Link tables together and are the charcteristics of the entity
Flat File
A database structure which has a single file and its attributes.
Primary Key
A unique identifier for each record in the table
Foreign Key
A attribute which links two tables together
foreign key will exist in one table as the primary key and act as the foreign key in another
Secondary Key
Allows databases to be searched quickly
{Order and Search}
(Index)
ERM (Entity Relationship Modelling)
Relationships between tables are shown in abstracted view
Relationships
defined by how many records they associate with in each table.
One-to-One
One-to-Many
Many-to-Many
Normalisation
The process of coming up with the best possible layout for a relational database
Normalisation Rules:
- no redundancy (unnecessary duplicates)
- Consistent data throughout linked tables.
- Records can be added and removed without issues.
- Complex queries (requests) can be carried out.
First normal Form
There must be no attribute that has more than 1 value
Second normal Form
A database which doesn’t have any partial dependencies and is in First Normal Form.
This means that no attributes can depend on part of a composite key (multiple keys in one used to identify rows).
Third normal Form
Database is in Second Normal form and contains no non-key dependencies it is in Third Normal Form.
Non-key dependency - the attribute only depends on the value of the primary key and nothing else.
Indexing
method used to store the position of each record ordered by a certain attribute.
Used to look up and access data quickly.
The primary key is automatically indexed
(but primary key is almost never queried as its forgotten. so secondary keys are used. Secondary keys are indexed to make the table easier and faster to search through on those particular attributes.)