Final Db Week 11
Final Db Week 11
SYSTEMS
WEEK 11 LECTURE 1 $ 2
AISHA RIAZ
Topics to Cover
BCNF is an extension to
Third Normal Form (3NF)
and is slightly stronger
than 3NF.
Also known as 3.5 NF.
BCNF
As you can see in the table above, student with s_id 1 has opted for
two courses, Science and Maths, and has two
hobbies, Cricket and Hockey.
You must be thinking what problem this can lead to, right?
Well the two records for student with s_id 1, will give rise to two more
records, as shown below, because for one student, two hobbies exists,
hence along with both the courses, these hobbies should be specified.
4th NF
4th NF Example
5th NF
It's in 4NF.
Identify the best normal form that R satisfies (1NF, 2NF, 3NF or
BCNF).C
Solution
Candidate Key is BD
Relation R is in 1NF but not 2NF. In above FDs, there is a partial dependency
(As per FD B → C, C depends only on B but Key is BD so C is partial depends
on key (BD))
(As per FD D → A, A depends only on D but Key is BD so A is partial depends
on key (BD))
Exercise 2
Suppose you are given a relation R with four attributes ABCD. For
each of the following sets of FDs, do the following: F = (C → D, C
→ A, B → C)
Identify the candidate key(s) for R.
Identify the best normal form that R satisfies (1NF, 2NF, 3NF or BCNF).
Candidate Key is B
Relation R is in 2NF but not 3NF. In above FDs, there is a transitive dependency
(As per FDs B → C & C → D then B → D so D is transitive depends on key (B))
(As per FDs B → C & C → A then B → A so A is transitive depends on key (B))
Exercise 3
Suppose you are given a relation R with four attributes ABCD. For
each of the following sets of FDs, do the following: F = (A → B, BC
→ D, A → C)
Identify the candidate key(s) for R.
Identify the best normal form that R satisfies (1NF, 2NF, 3NF or BCNF).
Candidate Key is A
Relation R is in 2NF but not 3NF. In above FDs, there is a transitive dependency
(As per FDs A → B & A → C then A → BC using union rule) and
(As per FDs A → BC & BC → D then A → D so D is transitive depends on key (A))
Exercise 4
Employee Project
Project Project Project
Number Code
Code Description Supervisor
1 1
1 IOT Patel
2 2
2 PHP Shah
3 1
1 2
3NF
Transaction Processing