Question 800
A pricing table admits negative unit prices despite a documented positive-price rule. Which implementation decision BEST addresses this requirement?
Explanation
Correct Answer
Use a CHECK constraint expressing the supported business condition. This targets the primary issue because application-layer validation alone can be bypassed by other writers. Verification: Direct SQL inserts with negative prices fail without affecting valid rows. Prevent recurrence: Retest constraints after bulk imports and schema changes.
Incorrect Answers
Referential integrity prevents orphan children unless cascade or other actions are deliberately configured.
Temporal history captures prior row versions when system versioning is enabled.
Partitioning is most helpful when queries constrain the partition key.