mysql約束取值范圍 創(chuàng)建表時mysql添加唯一約束條件?
創(chuàng)建表時mysql添加唯一約束條件?Trycreate table user(id int not null auto uuu Increase,name varchar(100)not null,p
創(chuàng)建表時mysql添加唯一約束條件?
Try
create table user
(
id int not null auto uuu Increase,
name varchar(100)not null,
password varchar(100)not null,
primary key(id),
unique key(name)
]事實上,這與您的MySQL版本有關,語法會有所不同
你可以下載mysqlbrowser的圖形界面,然后通過圖形方式生成語句
一般來說,檢查約束都是建立起來的。例如,列sex的值只能設置為“male”或“female”
創(chuàng)建表tab10時,命令是create table0(sex char(2)check(sex in(“male”,“female”)。