Sorry for the vague title, I'm not really sure how to define what I am trying to do.
I have 3 tables: categories - has a unique ID (cat_id) questions - has a unique ID and a category foreign key (ques_category_fk) answers - has a unique ID and a questions foreign key (ans_question_fk)
What I am trying to do is delete all the questions and answers under a single category. Deleting the questions is no problem. However, I'm not sure how to delete the answers using the same SQL statement.
I thought of loading all the questions, iterating through them or adding a category foreign key to the answers. Both of these seem inefficient.
Here is my current delete statement:
DELETE FROM questions WHERE ques_category_fk = @fk