Course
+ Subject
, then no violation of 1NF, 2NF, and 3NF.
Let’s list out all possible functional dependencies:
|
Course
+ Subject
is a candidate key.
Second one that is Course
+ Lecturer
is also a candidate key as we can identify tuples uniquely using it.
However the determinant of the third one cannot be used as a candidate key because it has duplicates.
You cannot make Lecturer
as a primary key.
Now you have a determinant that cannot be set as a primary key, hence it violates BCNF. In order to make the table BCNF table, need to decompose. |
Course
+ Subject
, then no violation of 1NF, 2NF, and 3NF.
Let’s list out all possible functional dependencies:
Course, Subject → Lecturer
Course, Lecturer → Subject
Lecturer → Subject
A database relation (a database table) is said to meet third normal form standards if all the attributes (database columns) are functionally dependent on solely the primary key.That is 3NF is a relation in second normal form where all non-prime attributes depend only on the candidate keys and do not have a transitive dependency on another key. This says that we should remove transitive dependency if they are exist. What is transitive dependency?
Student
relation, StudentCode
determines the Town
(StudentCode→Town
) and Town
determines the Province
(Town→Province
), therefore StudentCode
determines Province
(Note that, as per this relation StudentCode
detemines Province
but the issue is it can be determined by Town
too).
A
determines B
(A→B
) and B
determines C
(B→C
), then A
determines C
(A→C
).
For removing transitive dependency, we need to decompose the relation.
“Success - keeping your mind awake and your desire asleep.” — Walter Scott |