4.Candidate keys- The candidate keys are shown in bold. Team (teamID, name, category, lapCount, totalTIme, categoryPosition, overallPosition) Candidate key (teamID) Rider (riderID, name, age, phoneNumber) Candidate key (riderID) Race (lapDistance, startTime) Candidate key (lapDistance, startTime) lap (lapID, time, speed) Candidate key (lapID, time, speed) 5.Primary keys Team (teamID, name, category, lapCount, totalTIme, categoryPosition, overallPosition) Primary key (teamID) – This is the best attribute to be the primary key because every team has a unique teamID. Rider (riderID, name, age, phoneNumber) Primary key (riderID)- This is the best attribute for the primary key because every rider has a unique riderID. Race (raceID, lapDistance, startTime) Primary key (raceID)- Every race has should have a unique raceID thus this should qualify to be the primary key. lap (lapID, riderID, time, speed) Primary key (lapID,riderID)- Every lap has a unique lapID thus this qualifies to be the primary key 6.Primary keys and foreign keys Race (raceID, lapDistance, startTime) Primary key (raceID)- Every race has should have a unique raceID thus this should qualify to be the primary key. Team (teamID, name, category, lapCount, totalTIme, categoryPosition, overallPosition,raceID) Primary key (teamID) – This is the best attribute to be the primary key because every team has a unique teamID. Foreign key (raceID) references race (raceID) Rider (riderID, name, age, phoneNumber,teamID) Primary key (riderID)- This is the best attribute for the primary key because every rider has a unique riderID. Foreign key (teamID) references team (teamID) lap (lapID, riderID, time, speed)
End of preview
Want to access all the pages? Upload your documents or become a member.