What data type to use for a field that may contain a value from predefined values ​​in a database table?

I have one field with a name typein the database table. I want this field to contain a value from a list of predefined values. If I use setthis field as the data type, it can contain more than one value from the list.

What data type to use so that it can contain only one value from a list of values ​​(predefined)?

+1
source share
2 answers

For mySQL you want ENUM .

ENUM - , , .

MS SQL ENUM, . ( , .) . , CHECK.

+1

Source: https://habr.com/ru/post/1733650/


All Articles