Problem Statement
What is the most portable way to restrict a status column to a few allowed values?
Explanation
A CHECK with an IN list validates values at the database boundary and works across vendors.
Vendor-specific enums can be ergonomic, but CHECK is simple and portable.
Code Solution
SolutionRead Only
status TEXT NOT NULL CHECK (status IN ('NEW','PAID','CANCELLED'))Practice Sets
This question appears in the following practice sets:
