Consider the relation Courses (C, T, H, R, S, G), whose attributes may be though
ID: 3730587 • Letter: C
Question
Consider the relation Courses (C, T, H, R, S, G), whose attributes may be thought of informally as course, teacher, hour, room, student, and grade. Let the set of FD's for Courses be C T, HR C, HT R, HS R, and CS G. Intuitively, the first says that a course has a unique teacher, and the second says that only one course can meet in a given room at a given hour. The third says that a teacher can be in only one room at a given hour, and the fourth says the same about students. The last says that students get only one grade in a course.
1. What are all the candidate keys for Courses? 2. Decompose Courses into 3NF relations.
Explanation / Answer
1.
The candidate keys would be those which have HS with them hence we can see that it is a candidate key and there can't be more keys as if we add some attribute to it then it will be a super key not a candidate key
Hence the candidate key is HS
2.
It is in 2NF as there is not any partial dependency but there is a transitive dependency
We can remove that by decomposing it in
(HR C, HT R, HS R, and CS G),(C T)