📄 crebas.dat
字号:
/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2008-12-9 22:31:48 */
/*==============================================================*/
alter table COURSE
drop constraint FK_COURSE_REFERENCE_SC
go
alter table Students
drop constraint FK_STUDENTS_REFERENCE_SC
go
if exists (select 1
from sysobjects
where id = object_id('COURSE')
and type = 'U')
drop table COURSE
go
if exists (select 1
from sysobjects
where id = object_id('SC')
and type = 'U')
drop table SC
go
if exists (select 1
from sysobjects
where id = object_id('Students')
and type = 'U')
drop table Students
go
/*==============================================================*/
/* Table: COURSE */
/*==============================================================*/
create table COURSE (
Cno integer not null,
Tno integer null,
Cname varchar(10) not null,
Sno integer null,
Credit float null,
Ctime datetime null,
Cmark float null,
Caddr varchar(10) null,
Cexamt varchar(10) null,
Cterm varchar(10) null,
constraint PK_COURSE primary key (Cno, Cname)
)
go
/*==============================================================*/
/* Table: SC */
/*==============================================================*/
create table SC (
Sno integer not null,
Cno integer not null,
Tno integer not null,
Cterm varchar(10) null,
Cmark float null,
Column_6 char(10) null,
constraint PK_SC primary key (Sno, Cno, Tno)
)
go
/*==============================================================*/
/* Table: Students */
/*==============================================================*/
create table Students (
Sno integer not null,
Cno integer null,
Tno integer null,
Sname varchar(10) not null,
Ssex varchar(2) null,
Sbir datetime null,
Stime datetime null,
Stel integer null,
Semail varchar(20) null,
Scollege varchar(10) null,
Smajor varchar(10) null,
Saddr varchar(10) null,
Sbei varchar(255) null,
constraint PK_STUDENTS primary key (Sno, Sname)
)
go
alter table COURSE
add constraint FK_COURSE_REFERENCE_SC foreign key (Sno, Cno, Tno)
references SC (Sno, Cno, Tno)
go
alter table Students
add constraint FK_STUDENTS_REFERENCE_SC foreign key (Sno, Cno, Tno)
references SC (Sno, Cno, Tno)
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -