Question: Please Send a sql format response. I have Tried everything all the experts keep saying to do and none of them work! The Solutions I

Please Send a sql format response. I have Tried everything all the experts keep saying to do and none of them work! The Solutions I keep Recieving DO NOT WORK. I sent the error message I keep Recieving
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.
This is what happens when I try every experts answers. Below is a screenshot of the results.
HorseID INT Not NULL Check (HorseID 0 AND HorseID 65000),
StudentID INT CHECK (StudentID 0 AND StudentID 65000),
LessonDateTime DATETIME NOT NULL,
PRIMARY KEY (HorseID, LessonDateTime),
FOREIGN KEY (HorseID) REFERENCES Horse(ID) ON DELETE CASCADE,
FOREIGN KEY (StudentID) REFERENCES Student(ID) ON DELETE SET NULL
;
These are the ERROR CODES I RECEIVE WHEN I DO THIS!
LastName VARCHAR(30),
PRIMARY KEY (ID)
;
-- Your SQL statements go here
CREATE TABLE 'Lessonschedule' (
HorseID INT Not NULL Check (HorseID AND HorseID 6500),
StudentID INT CHECK (StudentID AND StudentID 65000),
LessonDateTime DATETIME NOT NULL,
PRIMARY KEY (HorseID, LessonDateTime),
FOREIGN KEY (HorseID) REFERENCES Horse(ID)('ON DELETE CASCADE'),
FOREIGN KEY (StudentID) REFERENCES student(ID)('ON DELETE SET NULL')
;
 Please Send a sql format response. I have Tried everything all

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