The given FDs are -
Epmployee#→Dept#,Manager#
Dept#→Manager#
course#→course_title
The table is-
I have decomposed it into 3 relations. They are in 3NF.
R1 (Employee#, Dept#) --- Employee is PK
R2 (Employee#, Course#, course_title, date) --- Emp# and Course# are PK
R3 (Dept#, Manager#) --- Dept# is PK
The Primary Keys are as above.
However, when I inserting the data into R2, I get a primary key conflict. It is in red. Where am I going wrong? Any help would be really appreciated.
A correct decomposition in your case is the following:
All the relations are in Boyce-Codd Normal Form (and for this reason they are also in 3NF).
Finally note that one could be tempted to coalesce the two relations R2 and R4, but this would have produced a decomposition not in 4NF (since an employee has only a department but can follow several courses).