内容发布更新时间 : 2024/12/22 19:11:30星期一 下面是文章的全部内容请认真阅读。
接下来,在数据库里(开始菜单-?程序-? microsoft SQL server-?查询分析器),数据库——系统数据库——master——表——右键,刷新, 就出来了新建的表。如下图。 四.实验结果 CDM图(ER图):
PDM图:
SQL代码: if exists (select 1 from sysobjects where id = object_id('Library') and type = 'U') drop table Library go if exists (select 1 from sysobjects where id = object_id('Unit') and type = 'U') drop table Unit go if exists (select 1 from sysobjects where id = object_id('book') and type = 'U') drop table book go if exists (select 1 from sysobjects where id = object_id('reader') and type = 'U') drop table reader go if exists (select 1 from sysobjects where id = object_id('\ and type = 'U') drop table \go /*==============================================================*/ /* Table: Library */ /*==============================================================*/ create table Library ( Library_No char(20) not null, Library_Address varchar(38) not null, constraint PK_LIBRARY primary key nonclustered (Library_No) )