Write a SQL Query to create a Schedule table, with columns: HorseID - integer with range 0 to 65535, not NULL Student ID integer with range 0 to 65535 Lesson DateTime - date/time, not NULL (HorseID, Lesson DateTime) is the primary key

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 10MC
icon
Related questions
Question
100%
The database contains a Horse table, with columns:
ID integer, primary key
Registered Name
variable-length string.
The database contains a Student table, with columns:
• ID integer, primary key
First Name - variable-length string
LastName variable-length string
Write a SQL Query to create a Schedule table, with columns:
HorseID - integer with range 0 to 65535, not NULL
• Student ID integer with range 0 to 65535
Lesson DateTime - date/time, not NULL
(HorseID, Lesson DateTime) is the primary key
Also, create the following foreign key constraints on Schedule columns:
HorseID references Horse. When an ID is deleted from Horse
matching Lesson Schedule rows are deleted.
Student ID references Student. When an ID is deleted
from Student, matching Student ID 's are set to NULL).
Transcribed Image Text:The database contains a Horse table, with columns: ID integer, primary key Registered Name variable-length string. The database contains a Student table, with columns: • ID integer, primary key First Name - variable-length string LastName variable-length string Write a SQL Query to create a Schedule table, with columns: HorseID - integer with range 0 to 65535, not NULL • Student ID integer with range 0 to 65535 Lesson DateTime - date/time, not NULL (HorseID, Lesson DateTime) is the primary key Also, create the following foreign key constraints on Schedule columns: HorseID references Horse. When an ID is deleted from Horse matching Lesson Schedule rows are deleted. Student ID references Student. When an ID is deleted from Student, matching Student ID 's are set to NULL).
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning