Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string   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, 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.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter11: Sql Server Databases
Section: Chapter Questions
Problem 6E
icon
Related questions
Question

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, 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.

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr