YEAR 1 CO1 WEEK 18 NORMALISATION Flashcards
In a database what are entities and attributes?
Entities are the tables and attributes are the fields.
Define relationships?
The links between entities.
Describe a one to one relationship.
Where for example a person only has one spouse and a spouse can only have one husband/wife.
Describe a one to many relationship.
Where a mother can give birth to many but the child can only be birthed by one mother.
Describe a many to many relationship.
Where a book can be loaned by many customers in a library and a customer can loan many books.
Should not make a many to many relationship between entities.
Achieved by adding another entity which acts as a link table and creates one to many relationship.
Makes relationship into 3NF
Reduces data inconsistencies.
What are the rules with standard notation for databases.
Entities should be written in capital letters.
Primary keys should be underlined.
Foreign keys should be overlined.
Define Normalisation.
The process of refining structure of a database to minimise redundancy and improve integrity.
If not normalised potentially has repeated data or inconsistent data.
Describe First Normal Form.
Where there are no repeating attributes and data is atomic.
Atomic data is information which cannot be logically broken down into smaller parts.
Eg. fullname split into forename and surname
Describe Second Normal Form.
If it is in 1NF.
There is no partial key dependencies.
If there is a compound primary key likely not to be in 2NF.
Describe Third Normal Form.
If it is in 2NF.
All data has to be related to the primary key.