4.10 Fundamentals of DB (Normalisation) Flashcards
What is Normalisation
The process which helps to organise and structure a database in a way which improves efficiency and integrity
What advantages does Data Normalisation bring
- No redundancy, making size smaller and so more money efficient
- One change cascades across related record making modification easier
- Less data to search through makes the process of the query faster
- Improves Data Integrity
What are the disadvantages of normalisation
- If the data is mad too atomic, fields may become unmeaningful
- More tables are made than in 0NF
- A more complex database is made meaning that querying data is also more complex and potentially slower
What is meant by a dependency
A value that varies in line with another value
What are the conditions for 0NF
- Non-Atomic data
- Repeating groups of data
What are the conditions for 1NF
- No repeating geoups of attributes (2 of the same attribute)
- Data is atomic
- Each record must have a primary key
Process of 0NF –> 1NF
- Separate repeating attributes into separate records.
- Separate non-atomic values into separate attributes
- Declare a primary key
What is meant by a partial key dependency
Where the value of a data field relies entirely on part of the primary key where the primary key is a composite key
What are the conditions for 2NF
- Must already be in 1st Normal Form
- The must be no Partial Key dependencies
How do you identify and fix partial key dependencies for n partial dependencies
- First ask for each non-key attribute “if the primary key changes does the attribute value change
- Make n new tables where for each new table the primary key is the part of the primary key that one of the field relied on.
What is meant by a non-key dependency
Where an attribute is determined by another attribute in a table that is not the primary key
What are the conditions for 3NF
a
- Must already be in second normal form
- Must have no non-key dependencies
How do you find non-key dependencies
a
Ask yourself:
“Is it ever possible for two records to have the same value in this field?”.
How do you fix non-key dependencies for n non-key dependencies
- Make n new tables, and for each one you should contain the non key dependency attributes