Question: 3.8 LAB - Create LessonSchedule table with FK constraints Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string

3.8 LAB - Create LessonSchedule table with FK constraints

Two tables are created:

  1. Horse with columns:

    • ID - integer, primary key
    • RegisteredName - variable-length string

  2. Student with columns:

    • ID - integer, primary key
    • FirstName - variable-length string
    • LastName - variable-length string

Create the LessonSchedule table with columns:

  • HorseID - integer with range 0 to 65 thousand, not NULL, partial primary key, foreign key references Horse(ID)
  • StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID)
  • LessonDateTime - date/time, not NULL, partial primary key

If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically.

If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically.

Note: Table and column names are case sensitive in the auto-grader.

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 Accounting Questions!