I need to prepare a SQLite trigger for following condition –
- There are three tables – retail_store, wholesale_store and product
- Tables retail_store and wholesale_store have column product_id from table product
Now I want to write a delete trigger such that if a product is deleted from retail_store and if it is not in table wholesale_store, then that product record should be deleted from product table.
** I understand as a practice it may not be a good idea to delete a product record like this. Please take this question only as a technical complication.
Thanks for considering this one. Cheers!
Maybe the following sql statemen is useful for you, but i can’t assure the syntax is correct.