I searched for answers to the following, but got answers mostly related to whether or not to use a surrogate at all, not about whether or not to then use compound keys on children of join tables.
I have a table attendees
and a table events
.
The join table is event_attendees
, containing two foreign keys attendee_id
and event_id
, and also has a surrogate primary key id
let's now say attendees in an event can have schedule_items
.
I would normally simply use the columns event_attendee_id
, schedule_item_id
in the table event_attendee_schedule_items
.
What drawbacks, if any, would using the following compound foreign key set up have over the above?
attendee_id
, event_id
, schedule_item_id
(compound key instead of a direct link to the event_attendees
table)?