In: Computer Science
Covert the schema into 2NF and 3NF
TableD (D1,D2,D3,D4,D5)
functionally dependencies: D4 --> D2
Answer:
Relation1:
Relation2:
The given table is:
TableD (D1,D2,D3,D4,D5)
The given functionality is:
D4 --> D2
The functional dependency is a relationship between two attributes in which the right-hand side attribute is functionally dependent on the left-hand side attribute.
Attribute D2 is determined by the value of D4.
Normalization is used to avoid anomalies.
First Normal Form:
A table is said to be in first normal form if and only if each cell of the table contains the atomic value. By default, every relation is in the first normal.
The given table is in first normal form by default.
Second Normal Form:
If there is no partial dependency then the relation is said to be in second normal form.
A functional dependency A->B is a partial dependency if some attribute 'X' belongs to A, can be removed from X, and then dependency still holds.
The given functional dependency is:
D4 --> D2
Here in the table, the primary key is not given.
As per the given data, the primary key will be:
D1, D3, D4, D5
Here D4 is the part of the primary key and partial dependency is there.
To remove the partial dependency, we need to break the table into two tables.
Relation1: (D1, D3, D5)
Relation2: (D2, D4)
If D4 is not the part of the key, then we need to break the table in third normal form to remove the transitive dependency.
Third Normal Form:
A relation or table is in third normal form if there is no transitive dependency.
Now in the given tables, there is no transitive dependency. So, these tables are in third normal form.
Relation1: (D1, D3, D5)
Relation2: (D2, D4)