two constrains for one column

Started by Ben-Nes Michaelover 24 years ago2 messagesgeneral
Jump to latest
#1Ben-Nes Michael
miki@canaan.co.il

Hi All

im trying to do the next thing, is it possible ?

CREATE TABLE language (
language serial PRIMARY KEY,
shortcut char(2) NOT NULL, unique, -- like il,en,fr,sp
);

#2Dr. Evil
drevil@sidereal.kz
In reply to: Ben-Nes Michael (#1)
Re: two constrains for one column

Yes, definitely. Just do:

CREATE TABLE language (
language serial PRIMARY KEY,
shortcut char(2) NOT NULL UNIQUE -- like il,en,fr,sp
);

and it should be fine.

Constraints are good.