MySQL Will you write the code in MySQL  Alter table employee so that column zipCode is a foreign key to table cityState, column zipCode Alter table customer so that column zipCode is a foreign key to table cityState, column zipCode zipCode is the foreign key. Cannot add or update a child row: a foreign key constraint fails (`dealership`.`#sql-163c_33`, CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`zipCode`) REFERENCES `citystate` (`zipCode`)) shows on my screen after I alter table employee.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 3MC: Which of the following SQL statements is invalid and returns an error message? ALTER TABLE books ADD...
icon
Related questions
Question

MySQL

Will you write the code in MySQL

 Alter table employee so that column zipCode is a foreign key to table cityState, column zipCode

Alter table customer so that column zipCode is a foreign key to table cityState, column zipCode

zipCode is the foreign key.

Cannot add or update a child row: a foreign key constraint fails (`dealership`.`#sql-163c_33`, CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`zipCode`) REFERENCES `citystate` (`zipCode`)) shows on my screen after I alter table employee.

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
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