How to use a SQL trigger for the wrong reason
A couple of days ago I came onto a question on Stackoverflow asking how to create a trigger to impose constraints. The question asked about a SQL trigger where the OP (original poster) asked for, and I quote:
” I understand the idea of triggers but a bit confused on how to use it to impose constraints.
For example I have two tables: a student table and book_order table that shows what book a student orders. I want to create a trigger that will check that a student with a book order cannot be deleted from the student table.”