Given a relation R( P, Q, R, S, T, U, V, W, X, Y) and Functional Dependency set FD = { PQ → R, PS → VW, QS → TU, P → X, W → Y }, determine whether the given R is in 2NF?Describe anomalies of database.(10marks)
Solution: Let us construct an arrow diagram on R using FD to calculate the candidate key.
From above arrow diagram on R, we can see that an attributes PQS is not determined by any of the given FD, hence PQS will be the integral part of the Candidate key, that is, no matter what will be the candidate key, and how many will be the candidate key, but all will have PQS compulsory attribute.
The relation R is not in 2NF as the attribute X depends on the proper subset(p) of the candidate key(PQS), hence it exhibits partial dependency.
Anomalies is a blip, abnormality on the screen that doesn't fit with the rest of the pattern.
Types include:
Insert Anomaly: An insert anomaly occurs when attribute cannot be inserted without the presence of other attributes
Update Anomaly: Occurs when duplicated data is updated at one instance and not all instances where it was duplicated
Delete Anomaly: Deletion of attributed which causes deletion of other attributes
Comments
Leave a comment