Question: In SQL what are the relationships between these tables? Like many to one and such. Also, I need to have business rules from these tables
In SQL what are the relationships between these tables? Like many to one and such. Also, I need to have business rules from these tables and need to determine if the primary keys and foreign keys are correct. Thank you...
| TRAIN |
| TRAIN_SCHEDULE |
| TRAIN_SEATS |
| TRAIN_ID (Foreign Key) | TRAIN_ID (Foreign Key) | SEAT_ID | ||
| TRAIN NAME (Primary Key) | STATION_ID | SEAT_NUMBER (Primary Key) | ||
|
| ARRIVAL_TIME | TRAIN_ID (Foreign Key) | ||
|
| DEPARTURE_TIME (Primary Key) |
|
| STATION |
| PASSENGER |
| RESERVATION |
| STATION_ID (Foreign Key) | PASSENGER_ID (Foreign Key) | RESERVATION_ID | ||
| STATION_NAME (Primary Key) | PASSENGER_FIRSTNAME | PASSENGER_ID (Foreign Key) | ||
| STATION_LOCATION | PASSENGER_LASTNAME (Primary Key) | DATE_OF_TRAVEL (Primary Key) | ||
|
| ADDRESS | STATION_ID | ||
|
|
| PHONE_NUMBER |
|
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
