Explore key principles of database normalization, from First Normal Form (1NF) through Fifth Normal Form (5NF). Assess your understanding of data redundancy, functional dependencies, and how each normal form improves database organization and consistency.
Which of the following scenarios violates First Normal Form (1NF) in a relational table?
Explanation: 1NF requires that each field in a table contains only atomic, indivisible values. Storing multiple phone numbers in one field violates this rule because the data is not atomic. Having null values in optional columns or ensuring unique primary keys do not violate 1NF. Data type uniformity in columns is good practice, but 1NF specifically addresses atomicity rather than types.
If a table is in 1NF but has partial dependencies on a composite primary key, which normal form is not satisfied?
Explanation: 2NF requires that there are no partial dependencies of non-prime attributes on any candidate key, which addresses issues with composite keys. If partial dependencies exist, the table is not in 2NF. 3NF and BCNF build on 2NF but address different types of dependencies. 4NF concerns multi-valued dependencies, which is a different concept.
Which situation prevents a table from being in Third Normal Form (3NF)?
Explanation: 3NF requires that all non-key attributes depend only on the primary key and not on other non-key attributes (i.e., no transitive dependency). If a non-key attribute depends on another non-key attribute, it breaks 3NF. Atomicity is a 1NF requirement, and having a single-column primary key does not inherently cause 3NF violations. The correct dependency structure is essential for 3NF.
Which scenario is a violation of Boyce-Codd Normal Form (BCNF) but may still be in 3NF?
Explanation: BCNF strengthens 3NF by requiring that every determinant must be a candidate key. If a non-candidate key determinant exists, BCNF is violated even if the table is in 3NF. Attributes being atomic addresses 1NF, and full key dependency is a concern of 2NF. Multi-valued dependencies are addressed by 4NF, not BCNF.
In the context of Fourth Normal Form (4NF), which issue does 4NF specifically address that previous normal forms do not?
Explanation: 4NF eliminates non-trivial multi-valued dependencies by ensuring that independent multi-valued facts are stored in separate tables. Transitive dependencies are handled by 3NF, and partial dependencies by 2NF. Repeated groups and denormalized data are mostly covered in 1NF.
When would Fifth Normal Form (5NF) decompositions be required for a table?
Explanation: 5NF is necessary if a table contains join dependencies that cannot be represented by decomposing on candidate keys alone. This often happens with complex relationships requiring further decomposition. Transitive dependencies are relevant for 3NF, and atomicity relates to 1NF. Partial dependencies are resolved by 2NF.
Which description best fits a table that is correctly in First Normal Form (1NF)?
Explanation: 1NF requires that every cell contains a single atomic value and that there are no repeating groups. Having no nulls is not a requirement for 1NF. Non-key attributes depending on other non-keys is a 3NF issue, and fields with multiple values break the atomicity required by 1NF.
Given a table with a composite primary key (OrderID, ProductID), which situation would violate Second Normal Form (2NF)?
Explanation: 2NF requires that non-prime attributes are fully functionally dependent on the entire composite primary key, not just part of it. If ProductName depends only on ProductID, it creates a partial dependency, which is not allowed in 2NF. Atomicity, unique identifiers, and dependencies on the whole key do not violate 2NF.
Which scenario best shows that a table is in Third Normal Form (3NF)?
Explanation: 3NF ensures that all non-key attributes are fully and only dependent on the primary key with no transitive dependencies. Repeating groups violate 1NF, and partial dependencies indicate violation of 2NF. The number or composition of candidate keys is not the main concern for 3NF.
Which of the following is an example of a multi-valued dependency in a database table?
Explanation: A multi-valued dependency arises when two or more attributes are independent but both depend on the same attribute, such as employees having multiple skills and multiple projects unconnected to each other. Dependencies involving only part of a candidate key are partial, not multi-valued. Non-key attributes determining others is a transitive dependency. Alternative names in one column does not illustrate independent multi-valued dependencies.