Last answered:

09 Jan 2023

Posted on:

07 Jan 2023

2

FOREIGN KEY constraint - Part II

Every was fine until this part,
Action:
ALTER TABLE sales  ADD FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ON DELETE CASCADE
Message:
Error Code: 1824. Failed to open the referenced table 'customers'

Any solutions

1 answers ( 0 marked as helpful)
Instructor
Posted on:

09 Jan 2023

0

Hi Gonzalo!
Thanks for reaching out.

Please make sure you've created (and filled with data) the customers table, and then retry the query.

Hope this helps.
Best,
Tsvetelin

Submit an answer