Hi everyone, I just learned the SQL course section Inserting, Updating, and Deleting Data - 9- Deleting Rows. As Mosh showed at the end of the video (01:21), we can delete rows from invoices table where client name = ‘Myworks’. I change Mosh’s code from SELECT * to SELECT client_id, which I think is correct, and name = ‘Myworks’ to name = ‘Vinte’. The others are the same with Mosh’s coding. But when I executed the query, I received an error, which said ‘Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (sql_invoicing
.payments
, CONSTRAINT fk_payment_invoice
FOREIGN KEY (invoice_id
) REFERENCES invoices
(invoice_id
) ON UPDATE CASCADE)’. Do you have any idea? Thanks in advance!