SQL语句创建表格时出问题了,麻烦各位帮忙看看,很急,谢谢啦
use StudentMIS
--创建学院表
create table DepartmentName
(
DepID int primary key,
DepName varchar(100) not null
)
insert into DepartmentName values(0,'全部院系')
insert into DepartmentName values(1,'数学与软件科学学院')
insert into DepartmentName values(2,'计算机科学学院')
insert into DepartmentName values(3,'物理与材料科学学院')
insert into DepartmentName values(4,'电子工程学院')
insert into DepartmentName values(5,'文学学院')
insert into DepartmentName values(6,'外语学院')
--创建班级表
create table Class
(
ClassID int primary key,
ClassName varchar(10) not null,
DepID int foreign key references DepartmentName(DepID)
)
insert into Class values(0,'全校班级',0)
insert into Class values(1,'1',1)
insert into Class values(2,'2',1)
insert into Class values(3,'3',1)
insert into Class values(4,'4',1)
insert into Class values(5,'1',2)
insert into Class values(6,'2',2)
insert into Class values(7,'3',2)
insert into Class values(8,'1',3)
insert into Class values(9,'2',3)
insert into Class values(10,'1',4)
insert into Class values(11,'2',4)
insert into Class values(12,'3',4)
insert into Class values(13,'1',5)
insert into Class values(14,'2',5)
insert into Class values(15,'1',6)
insert into Class values(16,'2',6)
create table TeachersLogin
(
--设置自增ID
TeacherID int identity(1,1) primary key,
--用作用户名
TeacherNum varchar(200) not null,
TeacherPwd varchar(200) not null,
--老师所在院系
DepID int foreign key references DepartmentName(DepID)
)
insert into TeachersLogin values('teacher001','123456',6)
insert into TeachersLogin values('teacher002','123456',3)
--创建学生详细信息表
create table StudentsDetails
(
Stu_ID int identity(1,1) primary key,
Stu_Num varchar(10),
Stu_Reg bit,
Stu_RegTime datetime,
Stu_Sex varchar(10),
Stu_Score varchar(10),