Normalisation (Week 12 Test) Flashcards
What is the purpose of normalization?
To group attributes into relations to minimize data redundancy and reduce file storage space required by base relations
What are the three reasons to normalize a database?
- Minimize duplicate data
- Minimize or avoid update anomalies
- Simplify queries to the database
What is redundancy in the context of databases?
Storing information redundantly, which wastes storage, decreases performance, and complicates data maintenance
What is an update anomaly?
Problems that arise from redundant information in tables, which can lead to inconsistent data
What is an insertion anomaly?
Occurs when a new record cannot be added without including redundant data or violating entity integrity
What is a deletion anomaly?
Occurs when deleting a record inadvertently removes important data about other entities
What is a modification anomaly?
Occurs when changes to data must be made in multiple places due to redundancy, risking inconsistency
What is a functional dependency?
A relationship where one attribute determines another; if A is known, B can be uniquely identified
How do you recognize the quality of relations design?
By identifying functional dependencies and ensuring the tables meet normalization requirements
What are the most commonly used normal forms?
- 1NF
- 2NF
- 3NF
What is the lossless-join property?
Ensures that any instance of the original table can be identified from corresponding instances in the smaller tables
What is the dependency preservation property?
Ensures that a constraint on the original table can be maintained by enforcing some constraint on each of the smaller tables
What is the process of normalization?
A formal technique for analyzing tables based on their primary keys and functional dependencies to decompose unsatisfactory tables
What is a normal form?
A condition using keys and functional dependencies of a relation/table to determine whether a relation schema is in a particular normal form
What are the higher normal forms beyond 3NF?
- Boyce–Codd Normal Form (BCNF)
- 4NF
- 5NF
True or False: Most of the time, you can stop at 3NF for good database design.
True
Fill in the blank: The technique of normalization involves a set of ______ to test individual tables.
rules
What is the main goal of decomposing a larger table into smaller tables?
To eliminate redundancy and prevent update anomalies
What happens if updates are not carried out in a poorly structured table?
The database may become inconsistent
How can one find functional dependencies in a relation?
By understanding the meaning of attributes and checking if one attribute consistently determines another
What is the determinant in a functional dependency?
An attribute or a group of attributes on the left-hand side of the functional dependency arrow
What is the impact of data redundancy on performance?
It decreases performance due to the increased effort needed for searching, sorting, and filtering data
What is a functional dependency?
An attribute or a group of attributes on the left-hand side of the functional dependency arrow.
What does the notation A → B imply in functional dependencies?
A determines B
What is a composite determinant?
A determinant that consists of more than one attribute.
What are the characteristics of functional dependencies used in normalization?
- One-to-one relationship between determinant and dependent attributes
- Hold for all time
- Minimal number of attributes necessary
What is normalization?
A formal technique for analyzing tables based on their primary key and functional dependencies.
What is the First Normal Form (1NF)?
A relational table storing information with atomic values and no repeating columns.
What does 1NF disallow?
- Composite attributes
- Multivalued attributes
- Nested tables/relations
What is the purpose of Second Normal Form (2NF)?
To eliminate partial dependencies on the primary key.
What does full functional dependency (FFD) indicate?
B is fully dependent on A if B is functionally dependent on A but not on any proper subset of A.
What is the Third Normal Form (3NF)?
Must satisfy the rules of 2NF and all columns should not be transitively dependent on the Primary Key.
What is an atomic value?
A single value at the intersection of each row and column in a table.
What is a repeating column?
A column that has multiple values for a single record.
What is an example of a relation schema that is NOT in 1NF?
A table with multivalued attributes or nested relations.
What is the primary key (PK) of a table?
A unique identifier for each row in the table.
How can you identify functional dependencies in a table?
By analyzing attributes to see if they describe what the primary key identifies.
What happens if an attribute is partially dependent on the primary key?
It should be moved to a different table with a copy of the primary key.
What is the effect of normalization on database design?
It narrows tables to have a single purpose and brings clarity to database design.
What is the process to move from 1NF to 2NF?
Identify the primary key, determine the table’s purpose, and analyze functional dependencies.
What should be done if attributes in a table violate 2NF?
Decompose the table to eliminate partial dependencies.
What does the notation (A, B) → C signify?
Neither A nor B will determine C by itself.
What is an example of a table that is in 1NF?
A table where each cell contains a single value, with no repeating groups.
What is the purpose of decomposing a table in normalization?
To reduce redundancy and avoid update anomalies.
What is a relation with nested relations?
A relation that contains another relation as an attribute.
What does 2NF stand for?
Second Normal Form
What is a key characteristic of a relation in 2NF?
All non-primary key attributes are fully dependent on the primary key.
Is R1 in 2NF?
Yes
Is R2 in 2NF?
No
Why is R2 not in 2NF?
Because ProjectName and ProjectLoc are NOT fully dependent on the primary key (StaffNo, ProjectNo).
What functional dependency is used to decompose EMPLOYEE_PROJECT into R1 and R2?
FD2
What does the 2NF version of EMPLOYEE_PROJECT consist of?
R1, R2_1, and R2_2
What is the definition of transitive dependency?
If A → B and B → C, then C is transitively dependent on A through B.
What is the purpose of 3NF?
To eliminate transitive dependencies on the primary key.
What is a defining feature of a table in 3NF?
It contains only columns that are non-transitively dependent on the primary key.
What do you need to do to move from 2NF to 3NF?
Identify and remove transitive dependencies by placing them in a new relation.
Is STAFF-BORROWER_2 in 3NF?
No
What is the issue with STAFF-BORROWER_2 that prevents it from being in 3NF?
FD2 creates a transitive dependency between Salary and StaffNo.
What is the significance of non-loss decomposition?
Properly normalized tables can always be combined back without loss of information.
What is the first step in normalizing the relation RENT to 2NF?
Identify functional dependencies that violate 2NF.
What functional dependencies are present in the RENT relation?
FD1, FD2, FD3, FD4
Fill in the blank: A table is in 3NF if it is in 2NF and contains only columns that are ______.
non-transitively dependent on the primary key
True or False: A relation can be in 2NF but not in 3NF.
True
What is a common issue that can arise in tables containing both grade and salary columns?
Inconsistency problems if one is updated and not the other.
What does 2NF stand for?
Second Normal Form
2NF reduces redundancy by ensuring that all non-key attributes are fully functionally dependent on the primary key.
What does 3NF stand for?
Third Normal Form
3NF requires that all attributes are only dependent on the primary key, eliminating transitive dependencies.
What is the purpose of normalization?
To reduce redundancy and eliminate update anomalies
Normalization improves data integrity and consistency.
Is every 3NF relation also in 2NF?
True
Every higher normal form includes all the properties of the previous forms.
What is the relationship between normal forms?
Each normal form is strictly stronger than the previous one
This hierarchy ensures increased data integrity.
What are functional dependencies?
Relationships that define how one attribute relates to another
They are key to establishing the structure of normalization.
Fill in the blank: Every 2NF relation is in ______.
1NF
This indicates that every relation in 2NF must also meet the criteria of 1NF.
What does each normal form provide?
A higher level of data integrity
This is achieved by controlling redundancy and eliminating update anomalies.