标签:
1、表的创建:
举例:
//主键 create table department ( dept_id int primary key, dept_name nvarchar(100) not null, dept_address nvarchar(100) ) //外键 create table employee ( emp_id int constraint pk_emp_id primary key, emp_name nvarchar(20) not null, emp_sex nchar(1), dept_id int constraint fk_dept_id foreign key references department(dept_id) )
create table student ( stu_id int primary key, stu_sal int check (stu_sal>=1000 and stu_sal<=8000) ) insert into student values(1,2000)
标签:
原文地址:http://www.cnblogs.com/Vae1990Silence/p/5391239.html