MySQL ENUMs - What are ENUMs used for in MySQL?

What are ENUMs used for in MySQL?

Using Enum can restrict the number of values that can be allowed to go inside a table. If there is an ENUM for Colors ENUM(‘blue’,’yellow’,’green’) I can use an insert statement like Insert colors values (‘red’).

What are ENUMs used for in MySQL?

ENUM is used to limit the values that persist in the table. The following example illustrates the best use of ENUM.
CREATE TABLE months (month ENUM ‘January’, ‘February’, ‘March’,);
INSERT months VALUES (’April’);
MySQL Aggregate Functions - Explain MySQL Aggregate Functions.
MySQL Aggregate Functions - Aggregate functions in MySQL are a group of functions that are used to operate on a set of values.....
MySQL - Describe Transaction-Safe Table Types in MySQL
MySQL Transaction-Safe Table - While using transactions in MySQL a transaction –safe table type must be used. MyISAM is the default table type....
MySQL Connection - Describe MySQL Connection using mysql binary
MySQL Connection - Establishing connection to MySQL database using Mysql binary can be done at command prompt....
Post your comment