sql - How can I create a trigger in sqlite database? -


i have create trigger in sqlite database.

there 3 tables in database

  • questions (question_id)
  • options (option_id, question_id)
  • answers (answer_id, question_id)

whenever row deleted question table, corresponding data should deleted option , answer tables.

i trying create trigger using

create trigger question_delete before delete on questions each row begin delete options question_id= old.question_id , delete answers question_id= old.question_id; end 

i error. should create 2 different trigger perform operation or changes required in above statement?

please let me know.

thanks nidhi

remove and after first delete statement:

delete options question_id = old.question_id; delete answers question_id = old.question_id; 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -