The query was:
DELETE
FROM sql_invoicing.invoices
WHERE client_id =
(SELECT client_id
FROM sql_store.customers
WHERE last_name = 'Smith')
In the above query the Database used has 'invoices' table in 'sql_invoicing' schema and 'customers' table is in 'sql_store' schema.
The error generated is :
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)
Pardon me if the question is naive, I am a beginner in MySQL.