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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started