【正文】
=======================================*/ /* Database name: NetTest (PDM) */ /* DBMS name: Microsoft SQL Server 2020 */ /* Created on: 2020611 11:28:20 */ /*==============================================================*/ alter table drop constraint FK_PAPERS_CREATE_TEACHERS go alter table drop constraint FK_PAPERS_TESTING_STUDENTS go if exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index go if exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index go if exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index go if exists (select 1 from sysindexes where id = object_id(39。 and indid 0 and indid 255) drop index go if exists (select 1 from sysobjects where id = object_id(39。) drop table go if exists (select 1 from sysobjects where id = object_id(39。) drop table go if exists (select 1 from sysobjects where id = object_id(39。) drop table go if exists (select 1 from sysobjects where id = object_id(39。) drop table go if exists (select 1 from sysobjects where id = object_id(39。) drop table go /*==============================================================*/ /* Table: Admin */ /*==============================================================*/ create table ( Name char(12) not null, PWD char(16) not null, constraint PK_ADMIN primary key (Name) ) go /*==============================================================*/ /* Index: Index_Name */ /*==============================================================*/ create index Index_Name on ( Name ) go /*==============================================================*/ /* Table: Papers */ /*==============================================================*/ create table ( ID bigint identity, TeacherID char(10) not null, StudentID char(10) not null, PaperID int not null, Subject varchar(50) not null, Score smallint null constraint CKC_SCORE_PAPERS check (Score is null or (Score = 0 )), constraint PK_PAPERS primary key (ID) ) go /*==============================================================*/ /* Index: Index_StudentID */ /*==============================================================*/ create index Index_StudentID on ( StudentID ) go /*==============================================================*/ /* Table: Questions */ /*==============================================================*/ create table ( QuestionID bigint identity, Subject varchar(50) not null, Question varchar(200) not null, Select1 varchar(100) not null, Select2 varchar(100) not null, Select3 varchar(100) not null, Select4 varchar(100) not null, Answer char(1) not null, constraint PK_QUESTIONS primary key (QuestionID) ) go /*==============================================================*/ /* Index: Index_SubjectID */ /*==============================================================*/ create index Index_SubjectID on ( Subject ) go /*==============================================================*/ /* Table: Students */ /*==============================================================*/ create table ( StudentID char(10) not null, Name char(12) not null, Age smallint not null constraint CKC_AGE_STUDENTS check (Age between 0 and 100), Sex char(2) not null, EnterTime datetime not null, PWD char(16) not null, Email varchar(35)