How can I create a table with a column with 3 only possible given values?

mysql, sql

Solution

See the `ENUM` type. http://dev.mysql.com/doc/refman/5.0/en/enum.html

i.e.

CREATE TABLE sizes (
    name ENUM('small', 'medium', 'large')
);

Problem

I'm making a SQL database with MySQL. I need a column that has only 3 possible values: "Total" "Hours" "OnDemmand". I mean that user has to select one of these three values, he will can't select another value. How can I do it?

Original source