I have a button to delete a customer. If a customer is deleted its getting deleted only from the customer table. But i have the customer's record in tables such as payments (where all the payment records are added) and comments (where all the user comments are added) .
I have customer id as foreign key in all tables. but its field name is different. for example in the customer_details table i have the customer id in the name of id and in other tables i have as lead_id.
what kind of query i should write to delete the records of a customer from all three (customer, comments, payments)tables ?