Database Normalization Flashcards
What does the 1st normal form (1NF) aim to do?
Eliminates repeating groups
What does the 2nd normal form (2NF) aim to do?
- Eliminates repeating groups
AND - Eliminates redundant data
What does the 3rd normal form (3NF) aim to do?
- Eliminates repeating groups
- Eliminates redundant data
- Eliminates columns not dependent on the primary key
What are some of the general principles for database normalization?
- Normal forms are additive
- “One fact, one place”
- All database tables should be in 3NF for this course.
When a table is not normalized, what is the database table referred as?
This database table would be considered a “flat file” which refers to a data file containing records with no structured relationships.
To put the tables in 3NF, we must ensure that:
Each table contains only data that helps us understand the primary key.
To put the table in 2NF, we must:
eliminate redundant data
To put the table in 1NF, we must:
eliminate repeating groups
What is a junction table?
It shows the relationship between two other tables.
Give one example of a junction table:
The client/services table is a junction table.
Junction tables normally have a __________.
compound primary key
Why do we need junction tables?
They are required when “many” instances of one item can be associated with “many” instances of another.
- Each client can have many services; each service can be associated with many clients.
Junction tables may join:
- Two master tables (Doctor/patient table)
- Two transaction tables (Bill client/collect payment table)
- One transaction table and one master table (Buy inventory/inventory table)
Why would Student/class be a required junction table?
A student may take many classes; each class may be taken by many students.
Why would Book/author be a required junction table?
A book may have many authors; an author may publish many books.