通过SQL语句创建与管理数据表
实验环境:SQL server2017
表:依次是Student,Course,SC。
1.通过SQL语句创建表
用SQL语句创建Student表,Course表,SC表。
Student表:涉及空值约束,主键约束,默认值约束,均为列级完整性约束,可直接写在在对应列后面。
create table Student(
Sno char(8) not null primary key,
Sname varchar(8) not null,
Sex char(2) not null default '男',
Birth smalldatetime not null,
Classno char(3) not null,
Entrance_date smalldatetime not null,
Home_addr varchar(40)
);
go
Course表:出现了新的约束,但仍