What are the primary and foreign keys in these tables? Also, what data constrain
ID: 3680395 • Letter: W
Question
What are the primary and foreign keys in these tables? Also, what data constraints exist from these tables? Thanks
TRAIN (table) TRAIN_ID TRAIN_NAME TRAIN_SCHEDULE (table) TRAIN_ID STATION_ID ARRIVAL_TIME DEPARTURE_TIME TRAIN_SEATS (table) SEAT_ID SEAT_NUMBER TRAIN_ID STATION (table) STATION_ID STATION_NAME STATION_LOCATION PASSENGER (table) PASSENGER_ID PASSENGER_FIRSTNAME PASSENGER_LASTNAME ADDRESS PHONE_NUMBER RESERVATION (table) RESERVATION_ID PASSENGER_ID DATE_OF_TRAVEL STATION_ID SEAT_RESERVATION (table) SEAT_ID RESERVATION_IDExplanation / Answer
Bellow constraints exist from these tables
not null - each value in a column must not be NULL
unique - value(s) in specified column(s) must be unique for each row in a table
primary key - value(s) in specified column(s) must be unique for each row in a table and not be NULL; normally each table in a database should have a primary key - it is used to identify individual records
foreign key - value(s) in specified column(s) must reference an existing record in another table (via it's primary key or some other unique constraint)
Bellow constraints exist from these tables
not null - each value in a column must not be NULL
unique - value(s) in specified column(s) must be unique for each row in a table
primary key - value(s) in specified column(s) must be unique for each row in a table and not be NULL; normally each table in a database should have a primary key - it is used to identify individual records
foreign key - value(s) in specified column(s) must reference an existing record in another table (via it's primary key or some other unique constraint)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.