4
I have this instruction in the database modeling archive and would like to know what it is.
'price_type' enum("S" "M")
4
I have this instruction in the database modeling archive and would like to know what it is.
'price_type' enum("S" "M")
8
It is a Enum.
With an Enum you can restrict the values of a column to the options specified, e.g., in your case 'S'
or 'M'
.
Enum is a very efficient and compact type. Internally the bank uses numbers to represent each value of enum
. We usually use Num when the values of a column belong to a well-defined static universe (i.e, you do not predict new price types, if that were the case a Foreign key to a domain table with price types would be a better solution).
Browser other questions tagged mysql sql
You are not signed in. Login or sign up in order to post.
Related: http://answall.com/q/81801/101 and http://answall.com/q/126301/101
– Maniero
Make this to sql become very meaningless since sql server does not have Num, if it were not for the tag, would not understand anything. Improve your question and see related above.
– Marco Souza
Possible duplicate of It is possible to create a decision structure in a table in SQL?
– Marco Souza