留个模块构成,建立它们各自内部的列属性,并相互关联它们彼此之间的关系,最后到完善的教务管理系统。(模型结构图如下)
教务管理系统模型图
四、调试分析:
10
教务管理系统详细设计代码如下:
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('Classmangement') and o.name 'FK_CLASSMAN_RELATIONS_DEPARTME') alter table Classmangement
drop constraint FK_CLASSMAN_RELATIONS_DEPARTME go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('GradeManagement') and o.name 'FK_GRADEMAN_RELATIONS_STUDENTM') alter table GradeManagement
drop constraint FK_GRADEMAN_RELATIONS_STUDENTM go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('GradeManagement') and o.name 'FK_GRADEMAN_RELATIONS_COURSEIN') alter table GradeManagement
drop constraint FK_GRADEMAN_RELATIONS_COURSEIN go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('TeachManage') and o.name 'FK_TEACHMAN_RELATIONS_COURSEIN') alter table TeachManage
drop constraint FK_TEACHMAN_RELATIONS_COURSEIN go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('TeachManage') and o.name 'FK_TEACHMAN_RELATIONS_TEACHERM') alter table TeachManage
drop constraint FK_TEACHMAN_RELATIONS_TEACHERM go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('TeacherManage') and o.name
11
=
=
=
=
=
=
'FK_TEACHERM_RELATIONS_COURSEIN') alter table TeacherManage
drop constraint FK_TEACHERM_RELATIONS_COURSEIN go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('studentmanage') and o.name = 'FK_STUDENTM_RELATIONS_DEPARTME') alter table studentmanage
drop constraint FK_STUDENTM_RELATIONS_DEPARTME go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('studentmanage') and o.name = 'FK_STUDENTM_RELATIONS_CLASSMAN') alter table studentmanage
drop constraint FK_STUDENTM_RELATIONS_CLASSMAN go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('教材使用') and o.name = 'FK_教材使用_教材使用_COURSEIN') alter table 教材使用
drop constraint FK_教材使用_教材使用_COURSEIN go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('教材使用') and o.name = 'FK_教材使用_教材使用2_SBMANAGE') alter table 教材使用
drop constraint FK_教材使用_教材使用2_SBMANAGE go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('教材发放') and o.name = 'FK_教材发放_教材发放_STUDENTM') alter table 教材发放
drop constraint FK_教材发放_教材发放_STUDENTM go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
12
where r.fkeyid = object_id('教材发放') and o.name = 'FK_教材发放_教材发放2_SBMANAGE') alter table 教材发放
drop constraint FK_教材发放_教材发放2_SBMANAGE go
if exists (select 1
from sysindexes
where id = object_id('Classmangement') and name = 'Relationship_7_FK' and indid > 0 and indid < 255)
drop index Classmangement.Relationship_7_FK go
if exists (select 1
from sysobjects
where id = object_id('Classmangement') and type = 'U') drop table Classmangement go
if exists (select 1
from sysobjects
where id = object_id('Courseinformationform') and type = 'U')
drop table Courseinformationform go
if exists (select 1
from sysobjects
where id = object_id('Departmentform') and type = 'U') drop table Departmentform go
if exists (select 1
from sysindexes
where id = object_id('GradeManagement') and name = 'Relationship_5_FK' and indid > 0 and indid < 255)
drop index GradeManagement.Relationship_5_FK go
13
if exists (select 1
from sysindexes
where id = object_id('GradeManagement') and name = 'Relationship_3_FK' and indid > 0 and indid < 255)
drop index GradeManagement.Relationship_3_FK go
if exists (select 1
from sysobjects
where id = object_id('GradeManagement') and type = 'U') drop table GradeManagement go
if exists (select 1
from sysobjects
where id = object_id('SBMANAGE') and type = 'U') drop table SBMANAGE go
if exists (select 1
from sysindexes
where id = object_id('TeachManage') and name = 'Relationship_9_FK' and indid > 0 and indid < 255)
drop index TeachManage.Relationship_9_FK go
if exists (select 1
from sysindexes
where id = object_id('TeachManage') and name = 'Relationship_8_FK' and indid > 0 and indid < 255)
drop index TeachManage.Relationship_8_FK go
if exists (select 1
from sysobjects
where id = object_id('TeachManage')
14