首頁 返回 下一步 最後一頁 摘要 圖形
Constraint(一)
not null與primary key
- create table car
 - (cid character (10) constraint pk primary key,
 -  model character(10) constraint nu not null,
 -  price integer default 100
 - );
 - insert into car (price) values (100);
 - insert into car (cid,price) values ('c01',100);
 
設定Constraint可以避免輸入錯誤
primary key 就是 not null且 unique