Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7 . 9 LAB - Create LessonSchedule table with FK constraints The database contains a Horse table, with columns: ID - integer, primary key RegisteredName

7.9 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 third table, named LessonSchedule, with columns:
HorseID - integer with range 0 to 65 thousand, not NULL, foreign key references Horse(ID)
StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID)
LessonDateTime - date/time, not NULL
Primary key is (HorseID, LessonDateTime)
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.
Notes: Table and column names are case sensitive in the auto-grader. Your SQL code does not display any results in Develop mode. Use Submit mode to test your code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

Describe the benefits of employee orientation.

Answered: 1 week ago

Question

Describe the Indian constitution and political system.

Answered: 1 week ago

Question

Explain in detail the developing and developed economy of India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = X 52+7 - 1)(x+2) dx

Answered: 1 week ago

Question

What is gravity?

Answered: 1 week ago

Question

What is the Big Bang Theory?

Answered: 1 week ago

Question

LO4 List options for development needs analyses.

Answered: 1 week ago