【正文】
課3_教室goalter table 學(xué)生 drop constraint FK_學(xué)生_RELATIONS_院系goalter table 學(xué)生 drop constraint FK_學(xué)生_屬于_院系goalter table 教室 drop constraint FK_教室_位置于_教學(xué)樓goalter table 教室借用 drop constraint FK_教室借用_教室借用_學(xué)生goalter table 教室借用 drop constraint FK_教室借用_教室借用2_教室goalter table 教師 drop constraint FK_教師_隸屬于_院系goif exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index goif exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index goif exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index goif exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index goif exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index goif exists (select 1 from sysindexes where id = object_id(39。) drop table Association_3goif exists (select 1 from sysobjects where id = object_id(39。) drop table 學(xué)生goif exists (select 1 from sysobjects where id = object_id(39。) drop table 教室goif exists (select 1 from sysobjects where id = object_id(39。) drop table 教師goif exists (select 1 from sysobjects where id = object_id(39。) drop table 院系go/*==============================================================*//* Table: Association_3 *//*==============================================================*/create table Association_3 ( 課程號(hào) char(10) not null, 教室編號(hào) char(10) not null, constraint PK_ASSOCIATION_3 primary key (課程號(hào), 教室編號(hào)))go/*==============================================================*//* Index: Association_3_FK *//*==============================================================*/create index Association_3_FK on Association_3 (課程號(hào) ASC)go/*==============================================================*//* Index: Association_4_FK *//*==============================================================*/create index Association_4_FK on Association_3 (教室編號(hào) ASC)go/*==============================================================*//* Table: 上課 *//*==============================================================*/create table 上課 ( 教師_教師編號(hào) char(20) not null, 課程_課程號(hào) char(10) not null, 教室_教室編號(hào) char(10) not null, 教室編號(hào) char(10) not null, 上課時(shí)間 datetime not null, 上課時(shí)間段 datetime not null, 教師編號(hào) char(20) null, 課程號(hào) char(10) null, constraint PK_上課 primary key (教師_教師編號(hào), 課程_課程號(hào), 教室_教室編號(hào)))go/*==============================================================*//* Index: 上課_FK *//*==============================================================*/create index 上課_FK on 上課 (教師_教師編號(hào) ASC)go/*==============================================================*//* Index: 上課2_FK *//*==============================================================*/create index 上課2_FK on 上課 (課程_課程號(hào) ASC)go/*============================================