Domain Constraints

A domain is the set of logically related values from which the value in a particular column can be drawn. Here are some examples of domains in the bookbiz database:

  • The domain of the authors.au_id column is all the Social Security numbers issued by the U.S. government.

  • The domain of the authors.city and publishers.city columns is all the cities in the United States; for authors.state and publishers. state, it's all the states in the United States. (Note the assumption that all authors live in the United States.)

  • The domain of titles.type is the following set of values: business, popular_comp, psychology, mod_cook, and trad_cook.

  • The domain of titles.title_id is the set of values with the following format: The first two characters ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.