sql server中如何为默认约束起约束名

2024-11-01 05:45:12
有1个网友回答
网友(1):

create table student
(
s_id int,
s_name varchar(20),
s_age int,
s_籍贯 varchar(10) default '汉族',
s_sex char(2) not null,
)
alter table student add constraint Agecheck check(s_age>15 and s_age<30)
alter table student add constraint primaryid primary key(s_id)