...谢谢了 如下三个表格。根据下面的建立 要代码就好了 万分感谢!_百度...
发布网友
发布时间:2024-10-05 10:38
我来回答
共1个回答
热心网友
时间:2024-10-22 11:27
create table Department
(
departId char(2) not null primary key ,
departName varchar(30) not null
)
create table Speciality
(
specId char(4) not null primary key ,
specName varchar(30) not null ,
departId char(2) null ,
foreign key(departId) references Department(departId)
)
create table Class
(
classId char(8) not null primary key ,
className varchar(30) null ,
specId char(4) null ,
departId char(2) null ,
remark varchar(30) null ,
foreign key(specId) references Speciality(specId) ,
foreign key(departId) references Department(departId)
)
热心网友
时间:2024-10-22 11:34
create table Department
(
departId char(2) not null primary key ,
departName varchar(30) not null
)
create table Speciality
(
specId char(4) not null primary key ,
specName varchar(30) not null ,
departId char(2) null ,
foreign key(departId) references Department(departId)
)
create table Class
(
classId char(8) not null primary key ,
className varchar(30) null ,
specId char(4) null ,
departId char(2) null ,
remark varchar(30) null ,
foreign key(specId) references Speciality(specId) ,
foreign key(departId) references Department(departId)
)