Databases Flashcards
Define entity, attribute and relationship
Entity = Object, person, event or thing of interest which data is to be recorded
Attribute = A property of an entity
Relationship = Link between two entities
3 types of relationships
One-to-one
One-to-many
Many-to-many
Define flat-file databases
Databases that use one entity
Disadvantages of flat-file databases
Data inconsistency
Data redundancy
Inefficiency
Difficult to maintain
Define relational databases
Databases with two or more linked tables
Define key terms for relational databases:
Primary key
Foreign key
Referential integrity
Composite key
Primary key - Attribute that uniquely represents a record
Foreign key - Attribute in one table that is primary key in another
Referential integrity - Value that appears in a foreign key in one table,
must be a primary key in another
Composite key - Combination of two or more attributes together
(instead of a singular primary key)
Define normalisation
Process of decomposing a flat-file into best relational database to minimise data redundancy
Summary of normalisation process
- Separate repeating groups into separate entities. Copy primary key as a foreign key
- All non-key attributes checked to see if only dependent on primary key (if not, create new entity)
- Tables with composite keys, ensure non-key attributes dependent on each part of the composite key (if not, create new entity)