Constraining Attribute Values
Constrain invalid values
- NOT NULL
- gender CHAR(1)
CHECK (gender IN (‘F’, ‘M’))
- MovieName CHAR(30)
CHECK (MovieName IN
(SELECT MovieName FROM Movies))
The constraint is checked whenever the value of the attribute is changed or added.
Isn’t this the same as REFERENCE?