views:

20

answers:

1

Hi, I am designing a database system for a web CMS. I have added the "status" column in the "Content" table which shows the status of each content in a time. i know there are only some special values which status can accept like : 'draft', 'comment waiting', authorizing pending' and .... i want to create a check constraint to make this colmun to accept only above values. is it a correct work? what are the whole of the status values which i can use in my constraint?

A: 

Use enum() for data type of the status column. e.g.:

CREATE TABLE example (
   ...
   status enum('draft','comment waiting','etc.') not null,
   ...
);
Narf