图书馆管理系统结构图
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
具体ER图如下:
管理人员表(admin):
读者表(reader):
图书表(book):
丢失图书表(Lossbook):
借书表(borrowbook):
表间关系:
Sql代码如下:
创建数据库
CREATEDATABASEDateBook
useDateBook
Go
创建admin表
CREATETABLEadmin(
passwordvarchar(30)NOTNULL)
创建Book表
CREATETABLEBook(
book_idintIDENTITY(1,1)CONSTRAINTPK_BookPRIMARYKEYCLUSTERED,
isbnvarchar(15)NOTNULL,
titlevarchar(100)NOTNULL,
student_idvarchar(50)NOTNULL,
reader_namevarchar(50)NOTNULL,
ageintNOTቤተ መጻሕፍቲ ባይዱULL,
academyvarchar(30)NOTNULL,
departmentvarchar(50)NOTNULL,
registerdatetimeNOTNULL,
reader_idintCONSTRAINTFK_borrowbook_readerFOREIGNKEYREFERENCESreader(reader_id),
book_idintCONSTRAINTFK_borrowbook_BookFOREIGNKEYREFERENCESBook(book_id),
authorvarchar(100)NOTNULL,
publishervarchar(80)NOTNULL,
pricefloatNOTNULL,
amountintNOTNULL,
total_amountintNOTNULL,
add_datedatetimeNOTNULL)
创建borrowbook表
CREATETABLEborrowbook(
图书馆管理系统结构图
——第四小组
数据库说明:
数据库名(DateBook);
主要有五张表:
图书表Book(book_id,isbn,title,author,publisher,price,amount,total_amount,add_date),
借书表Borrowbook(reader_id,book_id,borrpw_date,revertible_date),
borrpw_datedatetimeNOTNULL,
revertible_datedatetimeNOTNULL,
CONSTRAINT[PK_sno_CNO]PRIMARYKEY(book_id,reader_id)
)
创建reader表
CREATETABLEreader(
reader_idintIDENTITY(1,1)CONSTRAINT[PK_reader]PRIMARYKEYCLUSTERED,
admin_idintIDENTITY(1,1)NOTNULL,
admin_namevarchar(30)CONSTRAINTPK_adminInfoPRIMARYKEYCLUSTERED,
create_datedatetimeNOTNULL,
phonevarchar(15)NOTNULL,
emailvarchar(80)NOTNULL,
丢失图书表Lossbook(book_id,reader_id,loss_date),
读者表reader(reader_id,student_id,reader_name,age,academy,department,register,summary),
管理人员表admin(admin_id,admin_name,create_date,phone,email,password).
管理人员表(admin):
读者表(reader):
图书表(book):
丢失图书表(Lossbook):
借书表(borrowbook):
表间关系:
Sql代码如下:
创建数据库
CREATEDATABASEDateBook
useDateBook
Go
创建admin表
CREATETABLEadmin(
passwordvarchar(30)NOTNULL)
创建Book表
CREATETABLEBook(
book_idintIDENTITY(1,1)CONSTRAINTPK_BookPRIMARYKEYCLUSTERED,
isbnvarchar(15)NOTNULL,
titlevarchar(100)NOTNULL,
student_idvarchar(50)NOTNULL,
reader_namevarchar(50)NOTNULL,
ageintNOTቤተ መጻሕፍቲ ባይዱULL,
academyvarchar(30)NOTNULL,
departmentvarchar(50)NOTNULL,
registerdatetimeNOTNULL,
reader_idintCONSTRAINTFK_borrowbook_readerFOREIGNKEYREFERENCESreader(reader_id),
book_idintCONSTRAINTFK_borrowbook_BookFOREIGNKEYREFERENCESBook(book_id),
authorvarchar(100)NOTNULL,
publishervarchar(80)NOTNULL,
pricefloatNOTNULL,
amountintNOTNULL,
total_amountintNOTNULL,
add_datedatetimeNOTNULL)
创建borrowbook表
CREATETABLEborrowbook(
图书馆管理系统结构图
——第四小组
数据库说明:
数据库名(DateBook);
主要有五张表:
图书表Book(book_id,isbn,title,author,publisher,price,amount,total_amount,add_date),
借书表Borrowbook(reader_id,book_id,borrpw_date,revertible_date),
borrpw_datedatetimeNOTNULL,
revertible_datedatetimeNOTNULL,
CONSTRAINT[PK_sno_CNO]PRIMARYKEY(book_id,reader_id)
)
创建reader表
CREATETABLEreader(
reader_idintIDENTITY(1,1)CONSTRAINT[PK_reader]PRIMARYKEYCLUSTERED,
admin_idintIDENTITY(1,1)NOTNULL,
admin_namevarchar(30)CONSTRAINTPK_adminInfoPRIMARYKEYCLUSTERED,
create_datedatetimeNOTNULL,
phonevarchar(15)NOTNULL,
emailvarchar(80)NOTNULL,
丢失图书表Lossbook(book_id,reader_id,loss_date),
读者表reader(reader_id,student_id,reader_name,age,academy,department,register,summary),
管理人员表admin(admin_id,admin_name,create_date,phone,email,password).