offerzuloo.blogg.se

Correct use of enum in mysql
Correct use of enum in mysql












correct use of enum in mysql

Now, let us talk about the disadvantages: ENUMs makes the queries short by using the numeric indices instead of the Strings and thereby making the queries and the outputs readable.As numeric indices are being used to store the String values, so this is a compact data storage.Let us talk about the good things first, the advantages of the SQL ENUM data type are as follows: Advantages and Disadvantages of SQL ENUM Data Type The following is the syntax to be used for using the ENUM data type.Īs we expected, the Royale class comes first and the Club class comes at the very end, this happens because during the creation of the table Royale had an index of 3 and Club had an index of 1, and here we are doing the sorting in decreasing order. One can compare this to the Array data structure, the only differences are: The values are represented using numeric indices like 1 for the first value, 2 for the second value, and so on. ENUM is the short form for the term “Enumeration”. In SQL, the ENUM data type is a string object that allows us to limit the entries in a particular column by permitting only the String values specified for that column during the table creation.

#CORRECT USE OF ENUM IN MYSQL MOVIE#

While creating tables, or entering data in a table that has some repeated entries like the size of a shirt (Large, Medium, Small, etc), or seat type in a movie theater, have you ever thought that it would be really helpful if there was something to limit the entries to only those specific values, or something that would make your task easier by shortening the number of characters you need to type to do the same repeated task? If YES, then ENUM is something that will exactly meet your expectations!














Correct use of enum in mysql