ERROR 3780 (HY000) at line 14: Referencing column 'HorseID' and referenced column 'ID' in foreign key constraint
Fantastic news! We've Found the answer you've been seeking!
Question:
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:
Transcribed Image Text:
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... 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...
Expert Answer:
Answer rating: 100% (QA)
The error message indicates that there is a mismatch between the data types of the HorseID column in ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these databases questions
-
What is the preferable presentation of accounts receivable from officers, employees, or affiliated companies on a balance sheet??
-
Why due diligence, both legal and financial, is important for the song catalog purchase? Why it is important to understand the details of sources of income, how and when it is earned, and how it is...
-
Historical returns for the past three years for Stock B and the stock market portfolio are Stock B: 30 percent, 0 percent, 30 percent; market portfolio : 18 percent, 20 percent, 28 percent. The...
-
In Exercises evaluate the second derivative of the function at the given point. Use a computer algebra system to verify your result. (x) = cos x, (0, 1)
-
List two ways in which the OSI reference model and the TCP/IP reference model are the same. Now list two ways in which they differ.
-
Find the number of paths from a to e in the directed graph in Exercise 2 of length a) 2. b) 3. c) 4. d) 5. e) 6. f) 7.
-
Consider \(n\) independent random variables \(U_{1}, U_{2}, \ldots, U_{n}\), each of which obeys a Cauchy density function, \[ p_{U}(u)=\frac{1}{\pi \beta\left[1+\left(\frac{u}{\beta} ight)^{2}...
-
1. Does TOMS buy-one-give-one-away model make it a more ethical company than a traditional shoe manufacturer donating money to a charity? Why? 2. Why would customers pay such a high price for a...
-
Espresso Express operates a number of espresso coffee stands in busy suburban malls. The fixed weekly expense of a coffee stand is $2,100 and the variable cost per cup of coffee served is $0.52....
-
Identifytwo (2) additional needs or barriers to participation related to each of the five areas stated; Behavioural or psychological disorders Child at risk of harm Family circumstances and needs,...
-
In the next sets, you are given the magnitude and one component. There is an ambiguity in determining the vector, because you can only determine the absolute value of the other component and not its...
-
Describe an instance where in the last three years Tesla was impacted by foreign exchange transaction, translation, and operation exposure.
-
12. Write Python code that takes a number in base 2 as a string and converts it into a number in base 10. The name of the function is convert. Here is the output: 1 def convert(xstring): 2 #TO DO:...
-
how do gift cards get accounted for? When could this be a challenge for the revenue treatment?
-
What is the inventory cost flow assumption the entity uses? What are the pros and cons on using such assumption compared to the other two alternative commonly used inventory cost flow assumptions?...
-
Grouper Corporation's adjusted trial balance contained the following asset accounts at December 31, 2023: Prepaid Rent $22,900; Goodwill $52,000; Franchise Fees Receivable $3,000; Intangible...
-
A Potter makes bowls and planter pots. The table shows the pounds of clay needed and amount of time it takes to make one of each item. By summer the Potter worked for 220 hours. He used 150 pounds of...
-
KD Insurance Company specializes in term life insurance contracts. Cash collection experience shows that 20 percent of billed premiums are collected in the month before they are due, 60 percent are...
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Mallory Corporation has a calendar year-end. The corporation has paid estimated payments of $10,000 during 2012 but still owes an additional $5,000 for its 2012 tax year. a. When is the 2012 tax...
-
To correct the vision of a near-sighted patient, an optician needs to make a pair of eyeglasses using -3.0-diopter lenses. The lenses are plano-concave, and the front surface (that is, the surface...
-
A lens has an index of refraction of 1. 50 . Its left side curves outward with an absolute value of radius of curvature of \(0.15 \mathrm{~m}\), and its right side curves inward with an absolute...
-
You have a thin lens that is convex on both surfaces. The material of which the lens is made has index of refraction \(n=1.40\), and the radii of curvature are \(\left|R_{1} ight|=300 \mathrm{~mm}\)...
Study smarter with the SolutionInn App