I have a database entity relationship diagram with the following entities and their attributes:
Flight:
Date (primary key)
Num_available_seats
Reservation:
CustomerName
CustomerPhone
Seat:
SeatNumber (primary key)
Reservation is the middle ground relationship between the Flight and the Seat. There is a one-to-many relationship between Seat and Flight (namely, one Flight can have many Seats by way of Reservation).
When breaking down these relationships into tables, because this is a one-to-many relationship, I know that Seat can consume Reservation so that there doesn't need to be a specific Reservation table in the database.
However, my question is this... In the table for Seat, I know to put the primary keys of Seat and Flight (SeatNumber and Date), but do I also include the non-primary attributes of the Reservation relationship?
Here are my two options I'm toying around with:
Seat(SeatNumber, Date)
Seat(SeatNumber, Date, CustomerName, CustomerPhone)
Which one is correct? Thanks for the help!
To enhance data integrity I will suggest a little more constraints:
