O'Reilly logo

Mastering phpMyAdmin 3.1 for Effective MySQL Management by Marc Delisle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ENUM and SET

Both these field types are intended to represent a list of possible values. The difference is that the user can choose only one value from a defined list of values with ENUM, and more than one value with SET. With SET, all the multiple values go into one cell; but multiple values do not imply the creation of more than one row of data.

We add a field named genre to the book table and define it as an ENUM. For now, we choose to put short codes in the value list and make one of them, F, into the default value as shown in the following screenshot:

ENUM and SET

In the value list, we have to enclose each value within single quotes, unlike in the default ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required