Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ERROR 3780 (HY000) at line 14: Referencing column 'HorseID' and referenced column 'ID' in foreign key constraint 'lessonschedule_ibfk_1' are incompatible. Correct this code: 1 CREATE

ERROR 3780 (HY000) at line 14: Referencing column 'HorseID' and referenced column 'ID' in foreign key constraint 'lessonschedule_ibfk_1' are incompatible.

1 CREATE TABLE Horse ( ID 2 3 RegisteredName VARCHAR(15), 4 PRIMARY KEY (ID) 5 6 7 8 9 10 11 PRIMARY KEY (ID) Correct this code:

1 CREATE TABLE Horse ( ID 2 3 RegisteredName VARCHAR(15), 4 PRIMARY KEY (ID) 5 6 7 8 9 10 11 PRIMARY KEY (ID) 12 ); 13 ); SMALLINT UNSIGNED AUTO_INCREMENT, CREATE TABLE Student ( ID FirstName LastName Main.sql SMALLINT UNSIGNED AUTO_INCREMENT, VARCHAR (20), VARCHAR(30), 14 CREATE TABLE LessonSchedule ( 15 HorseID INTEGER NOT NULL, 16 Student ID INTEGER, 17 LessonDateTime DATETIME NOT NULL, 18. PRIMARY KEY (HorseID, LessonDateTime), 19 FOREIGN KEY (HorseID) REFERENCES Horse (ID) ON DELETE CASCADE, 20 FOREIGN KEY (StudentID) REFERENCES Student (ID) ON DELETE SET NULL 21 ); 22 23 24 | Load default template... 1 CREATE TABLE Horse ( ID 2 3 RegisteredName VARCHAR(15), 4 PRIMARY KEY (ID) 5 6 7 8 9 10 11 PRIMARY KEY (ID) 12 ); 13 ); SMALLINT UNSIGNED AUTO INCREMENT, CREATE TABLE Student ( ID FirstName LastName Main.sql SMALLINT UNSIGNED AUTO INCREMENT, VARCHAR (20), VARCHAR(30), 14 CREATE TABLE LessonSchedule ( 15 HorseID INTEGER NOT NULL, 16 Student ID INTEGER, 17 LessonDateTime DATETIME NOT NULL, 18. PRIMARY KEY (HorseID, LessonDateTime), 19 FOREIGN KEY (HorseID) REFERENCES Horse (ID) ON DELETE CASCADE, 20 FOREIGN KEY (StudentID) REFERENCES Student (ID) ON DELETE SET NULL 21 ); 22 23 24 | Load default template...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

The error message indicates that there is a mismatch between the data types of the HorseID column in ... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions

Question

What is a make-or-buy decision?

Answered: 1 week ago

Question

Solve the following equations for x to five-figure accuracy

Answered: 1 week ago