Search⌘ K
AI Features

Synopsis: 31 Flavors

Explore methods to enforce data integrity in SQL tables by restricting column values using ENUM data types, CHECK constraints, and lookup tables. Understand their applications and limitations through practical examples such as salutations and bug statuses. This lesson prepares you to handle evolving value sets in database columns effectively.

In a personal contact information table, the salutation is a good example of a column with only a few values. Once we support Mr., Mrs., Ms., Dr., and Rev., we’ve accounted for virtually everyone. We could specify this list in the column definition, using a data type or a constraint, so that no one can accidentally enter an invalid string in the ...