What does this piece of sql statement mean?

Asked

Viewed 51 times

4

I have this instruction in the database modeling archive and would like to know what it is.

'price_type' enum("S" "M")

1 answer

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

You are not signed in. Login or sign up in order to post.