Now the question asks me to find out the Functional Dependencies and Candidate Keys.
I’m slightly confused when I’m figuring out the FDs and Candidate Keys. From my understanding you can find FDs if "Given one value of X do I know one value of Y"? So for example if I’m given a studentID will I know the studentName? Yes. Thats simple enough.
Now for a candidate key I think they are keys which could possibly be a primary key but necessarily used as the primary key.
Now I have a scenario:
An employment placement agency is creating a database to record
interview appointment details. The agency employs ‘placement managers’
(PLMs) who assist ‘candidates’ (CNDs) to find work. Each placement
manager interviews many candidates. However a candidate is assigned to
one placement manager. This means that for each appointment that a
candidate has, it will always be with the same placement manager. Any
given appointment is between one candidate and their assigned
placement manager.An initial schema for the agency is:
Appointment(Appt, PLM#, PLMname, CND#, CNDname, CNDaddress, Job)Appt is the appointment day and time. PLM# & PLMname are the ID and name of
the placement manager, CND# is the ID of the candidate. CNDname is the
candidate’s name. CNDaddress is the contact address of the candidate.
Job is the job being discussed in the interview.
So for the above scenario the Candidate Keys might be:
{PLM# Appt} and {CND#, Appt}
My problem here is that I’m not sure whether to write it out as the above or have just 1 candidate key
{PLM#, CND#, Appt}
FDs:
PLM# -> PLMName
CND# -> CNDName
CND# -> CNDAddress
CND#, PLM# -> Appt
CND#, Appt -> Job
CND# -> Appt
CND# -> Job
CND# -> PLM#
Assumptions
1 Job is discussed during the appointment
A candidate can only have 1 appointment per day
Just want to get my FDs checked before I normalise.
The FD
CND ⟶ Jobis suspect, especially givenCND, Appt ⟶ Job; it would mean that a CND can only apply for, or discuss, one Job, ever.The FD
CND ⟶ Apptis suspect; it means that even if there are 50 PLM’s, no two could have an appointment at the same time.As to the question about keys: each of the two-column keys is a candidate key and is irreducible. The suggested three-column key is not irreducible (because it can be reduced to either of the two two-column candidate keys). Thus, the three-column key is a (strict) super-key and not a candidate key.