FOREIGN KEY constraint - Part II
Every was fine until this part,
ALTER TABLE sales ADD FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ON DELETE CASCADE
Error Code: 1824. Failed to open the referenced table 'customers'
1 answers ( 0 marked as helpful)
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.
Submit an answer
Why did you not do not null, primary key and auto increment for customer id in the solution?
Resolved: foreign key : able to see foreign key in the table sales DDL tab , but the Foreign Keys tab is empty