Hello Melanie
If your set of items will by static and small, then you can use CHECK
constraint. I use it for five, items itemes.
You can write more simple this constraint
...
user_type TEXT NOT NULL CHECK (user_type IN ('Root','Admin','Standard')),
regards
Pavel Stehule
On Mon, 22 Dec 2
On Mon, Dec 22, 2003 at 04:37:51PM -0500, Melanie Bergeron wrote:
> I want to know what's better between these 2 solutions :
>
> CREATE TABLE user (
> ...
> user_type text CHECK(user_type='Root' OR user_type = 'Admin' OR
> user_type = 'Standard'));
>
> or the following :
>
> CREATE TABLE
On 22/12/2003 21:37 Melanie Bergeron wrote:
Hi all!
I want to know what's better between these 2 solutions :
CREATE TABLE user (
...
user_type text CHECK(user_type='Root' OR user_type = 'Admin' OR
user_type = 'Standard'));
or the following :
CREATE TABLE user_type(
user_type_id integ