Chapter 23. The ENUM and SET Types
23.1 Introduction
Two special data types have not been discussed at all in this book: ENUM
(enumeration) and SET
. Both data types can be used if the number of values that a column may contain is restricted. For example, in the SEX column of the PLAYERS table, only two values may be entered: M
or F
. And in the POSITION column of the COMMITTEE_MEMBERS table, only the values Member
, Secretary
, Treasurer
, or Chairman
may appear. For both columns, the number of permitted values is restricted. This differs from columns such as PLAYERNO and AMOUNT, which must fulfill certain conditions but ultimately may contain all kinds of values.
The way the PLAYERS and COMMITTEE_MEMBERS tables have been defined now makes it possible ...
Get SQL for MySQL Developers: A Comprehensive Tutorial and Reference 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.