If every non-key attribute is functionally dependent on the primary ke...
Conditions for various normal forms:
- 1 NF – A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only.
- 2 NF – A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key.
- 3 NF – A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-transitively dependent on the primary key.
- BCNF – A relation R is in Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key.
Example:
Relation R(XYZ) with functional dependencies {X -> Y, Y -> Z, X -> Z}.
Notice here Y -> Z, in question it is not mention that non prime attribute is only dependent on primary key so this FD is perfectly valid.
This relation is in 2NF but not in 3NF because of every non-key attribute is transitively dependent on the primary key. Here {X} will be candidate key.
View all questions of this test
If every non-key attribute is functionally dependent on the primary ke...
Explanation:
To understand why the correct answer is option 'C', we need to understand the concept of normalization in database design.
Normalization is a process of organizing data in a database to reduce redundancy and dependency. It helps to eliminate data anomalies and inconsistencies, and ensure data integrity and consistency.
In normalization, there are several normal forms, each with its own rules and requirements. The most commonly used normal forms are:
1. First normal form (1NF)
2. Second normal form (2NF)
3. Third normal form (3NF)
4. Fourth normal form (4NF)
5. Fifth normal form (5NF)
Now, let's understand each normal form in detail and see how they relate to the question asked.
1. First normal form (1NF):
First normal form (1NF) is the simplest form of normalization, which requires that a relation must have atomic values. In other words, each attribute of a relation must contain only a single, indivisible value.
For example, consider a relation that stores information about students and their courses:
Student ID | Name | Course 1 | Course 2 | Course 3
--------------------------------------------------
1 | John | Math | Science | English
2 | Mary | Science | History | NULL
This relation is not in 1NF because the attributes Course 1, Course 2, and Course 3 contain multiple values, separated by commas. To bring this relation to 1NF, we need to split the multivalued attributes into separate relations:
Student ID | Name
------------------
1 | John
2 | Mary
Student ID | Course
--------------------
1 | Math
1 | Science
1 | English
2 | Science
2 | History
2. Second normal form (2NF):
Second normal form (2NF) requires that a relation must be in 1NF and every non-key attribute must be functionally dependent on the entire primary key.
For example, consider a relation that stores information about orders and their items:
Order ID | Customer ID | Item ID | Item Name | Quantity | Price
----------------------------------------------------------------
1 | 100 | 1 | Widget | 2 | $10
1 | 100 | 2 | Gadget | 1 | $20
2 | 200 | 2 | Gadget | 3 | $20
This relation is not in 2NF because the non-key attribute Item Name is functionally dependent on the Item ID, which is only part of the primary key. To bring this relation to 2NF, we need to split it into two relations:
Order ID | Customer ID | Item ID | Quantity | Price
----------------------------------------------------
1 | 100 | 1 | 2 | $10
1 | 100 | 2 | 1 | $20
2 | 200 | 2 | 3 | $20
Item ID | Item Name
-------------------
1 | Widget
2 | Gadget
3. Third normal form (3NF):
Third normal form (3NF) requires that a relation must be in 2NF and every non-key attribute must be functionally dependent on the primary key, and nothing but the primary key.
For example, consider a relation that stores information about employees and
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).