Question: 3 . 1 4 LAB - Create LessonSchedule table with FK constraints The database contains a Horse table, with columns: ID - integer, primary key

3.14 LAB - Create LessonSchedule table with FK constraints
The database contains a Horse table, with columns:
ID - integer, primary key
RegisteredName - variable-length string
The database contains a Student table, with columns:
ID - integer, primary key
FirstName - variable-length string
LastName - variable-length string
Create a LessonSchedule table, with columns:
HorseID - integer with range 0 to 65535, not NULL
StudentID - integer with range 0 to 65535
LessonDateTime - date/time, not NULL
(HorseID, LessonDateTime) is the primary key
Create the following foreign key constraints on LessonSchedule columns:
HorseID references Horse. When an ID is deleted from Horse, matching LessonSchedule rows are deleted.
StudentID references Student. When an ID is deleted from Student, matching StudentID's are set to NULL.
To confirm that LessonSchedule has been created, add the SHOW COLUMNS FROM LessonSchedule; statement.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!