Professional Documents
Culture Documents
Loss of information.
A B C A B B C
1 A 1 1 A
2 B 2 2 B
r A,B(r) B,C(r)
A B C
A (r) B (r)
1 A
2 B
Insertion anomalies: If new teacher is added, but s/he is not assign to any
department or any course and if null entries are not allowed in database then
insertion anomalies occur.
Deletion anomalies: If management department is deleted then records of
teacher as well as course name also deleted from database.
Update anomalies: If department assign to R K Agrawal is an error, then it need
to updated at two places to make consistency.
Functional Dependencies
Functional dependency is a relationship that exists when one
attribute uniquely determines another attribute.
Find (C,D)+
Find (B,C)+
Prepared By Kul P. Paudel,Relational Database Design
Problem
• Consider the given functional dependencies-
AB → CD
AF → D
DE → F
C→G
F→E
G→A
i. { CF }+ = { A , C , D , E , F , G }
ii. { BG }+ = { A , B , C , D , G }
iii. { AF }+ = { A , C , D , E , F , G }
iv. { AB }+ = { A , C , D , F ,G }
{ CF }+ = { C , F }
= { C , F , G } ( Using C → G )
= { C , E , F , G } ( Using F → E )
= { A , C , E , E , F } ( Using G → A )
= { A , C , D , E , F , G } ( Using AF → D )
Note: A Candidate key is always super key but not vice versa.
Staff (s_id,name,city,state)
FD: s_id name,s_idcity, s_idstate, citystate
Closure of attribute set
(s_id)+= (name, city, state)
(s_id,name)+= (name, city, state)
(s_id,city)+= (name, city, state)
(s_id,state)+= (name, city, state)
(name)+= (name)
(city)+= (city,state)
(s_id)+,(s_id,name)+,(s_id,city)+ ,(s_id,state)+ determine all the attributes of relation set
so all of these are super key.
Here minimal super key is s_id so it is candidate key.
Prepared By Kul P. Paudel,Relational Database Design
• In a schema with attributes A, B, C, D and E following set of
functional dependencies are given
{A -> B, A -> C, CD -> E, B -> D, E -> A}
Which of the following functional dependencies is NOT implied by
the above set?
A. CD -> AC
B. BD -> CD
C. BC -> CD
D. AC -> BC
• Answer: Using FD set given in question,
(CD)+ = {CDEAB} which means CD -> AC also holds true.
(BD)+ = {BD} which means BD -> CD can’t hold true. So this FD is no
implied in FD set. So (B) is the required option.
Given table is not in 1NF because knowledge has more than one
value.
Solution : split table
Prepared By Kul P. Paudel,Relational Database Design
Cont..
eid Name Job Dep_id eid Knowledge