How to delete rows in tables that contain foreign keys to other tables

Viewed 278094

Suppose there is a main table containing a primary key and there is another table which contains a foreign key to this main table. So if we delete the row of main table it will delete the child table also.

How do I write this query?

5 Answers
Related