🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Views, Triggers and Procedures: all 10 questions

Quiz: Views, Triggers and Procedures · Question 9 of 10

Stock must never go below zero. What is the simplest safe rule?

Stock must never go below zero. What is the simplest safe rule?

  1. A.A stored procedure that developers should remember to call
  2. B.A materialized view
  3. C.A comment in the code
  4. D.A CHECK (stock >= 0) constraint on the column
Answer & explanation

Correct answer: A CHECK (stock >= 0) constraint on the column

Prefer a constraint for simple rules; use triggers only when a constraint cannot express it.

Can you get the rest right without peeking?

Take the timed Quiz: Views, Triggers and Procedures quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →