← 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?
- A.A stored procedure that developers should remember to call
- B.A materialized view
- C.A comment in the code
- 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 →