KITFORMA · EDITORIAL ANSWER
Why does a CHECK constraint still allow a NULL value?
KitForma editorial guide. A CHECK constraint accepts a result that is true or unknown; it rejects false. A comparison involving NULL can therefore pass without proving the intended value exists.
Step-by-step answer
CHECK (quantity > 0) with NOT NULL when presence is required. Test positive, zero, negative and NULL values directly against the database. Do not rely only on a form validator, because imports and background jobs may bypass it. Cross-row or cross-table invariants generally need a different design; a simple CHECK should not pretend to validate changing external state.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This editorial answer was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.