图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx

上传人:b****1 文档编号:14738720 上传时间:2022-10-24 格式:DOCX 页数:24 大小:501.10KB
下载 相关 举报
图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx_第1页
第1页 / 共24页
图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx_第2页
第2页 / 共24页
图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx_第3页
第3页 / 共24页
图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx_第4页
第4页 / 共24页
图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx_第5页
第5页 / 共24页
点击查看更多>>
下载资源
资源描述

图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx

《图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx》由会员分享,可在线阅读,更多相关《图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx(24页珍藏版)》请在冰豆网上搜索。

图书管理系统数据库设计MYSQL实现培训资料Word文件下载.docx

4.学生直接归还图书,根据图书编码修改借阅信息5.管理员登陆管理系统后,可以修改图书信息,增加或者删除图书信息6.管理员可以注销学生信息。

通过需求定义,画出图书管理系统的数据流图:

数据流图数据流图二、系统功能设计二、系统功能设计画出系统功能模块图并用文字对各功能模块进行详细介绍。

系统功能模块图:

三、数据库设计方案图表三、数据库设计方案图表1、系统、系统E-R模型模型总体E-R图:

精细化的局部E-R图:

学生借阅-归还E-R图:

管理员E-R图:

2、设计表、设计表给出设计的表名、结构以及表上设计的完整性约束。

student:

列名数据类型是否为空/性质说明stu_idintnotnull/PK标明学生唯一学号stu_namevarcharnotnull学生姓名stu_sexvarcharnotnull学生性别stu_ageintnotnull学生年龄stu_provarcharnotnull学生专业stu_gradevarcharnotnull学生年级stu_integrityintnotnull/default=1学生诚信级book:

列名数据类型是否为空/性质说明book_idintnotnull/PK唯一书籍序号book_namevarcharnotnull书籍名称book_authorvarcharnotnull书籍作者book_pubvarcharnotnull书籍出版社book_numintnotnull书籍是否在架上book_sortvarcharnotnull书籍分类book_recorddatatimenull书籍登记日期book_sort:

列名数据类型是否为空/性质说明sort_idvarcharnotnull/PK类型编号sort_namevarcharnotnull类型名称borrow:

存储学生的借书信息列名数据类型是否为空/性质说明student_idvarcharnotnull/PK学生编号book_idvarcharnotnull/PK书籍编号borrow_datedatatimenull借书时间expect_return_datedatetimenull预期归还时间return_table:

存储学生的归还信息列名数据类型是否为空/性质说明student_idvarcharnotnull/PK学生编号book_idvarcharnotnull/PK书籍编号borrow_datedatetimenull借书时间return_datedatatimenull实际还书时间ticket:

存储学生的罚单信息列名数据类型是否为空/性质说明student_idvarcharnotnull/PK学生编号book_idvarcharnotnull/PK书籍编号over_dateintnull超期天数ticket_feefloatnull处罚金额manager:

列名数据类型是否为空/性质说明manager_idvarcharnotnull/PK管理员编号manager_namevarcharnotnull管理员姓名manager_agevarcharnotnull管理员年龄manager_phonevarcharnotnull管理员电话3、设计索引、设计索引给出在各表上建立的索引以及使用的语句。

1.为stu_id创建索引,升序排序sql:

createindexindex_idonstudent(stu_idasc);

2.为stu_name创建索引,并且降序排序sql:

altertablestudentaddindexindex_name(stu_name,desc);

插入索引操作和结果如下所示:

mysqlcreateindexindex_idonstudent(stu_idasc);

QueryOK,0rowsaffectedRecords:

0Duplicates:

0Warnings:

0mysqlaltertablestudentaddindexindex_name(stu_namedesc);

0mysqlbook:

1.为book_id创建索引,升序排列sql:

createindexindex_bidonbook(book_id);

2.为book_record创建索引,以便方便查询图书的登记日期信息,升序:

sql:

createindexindex_brecordonbook(book_record);

插入索引的操作和结果如下所示:

mysqlcreateindexindex_bidonbook(book_id);

0mysqlcreateindexindex_brecordonbook(book_record);

0borrow:

1.为stu_id和book_id创建多列索引:

createindexindex_sid_bidonborrow(stu_idasc,book_idasc);

mysqlcreateindexindex_sid_bidonborrow(stu_idasc,book_idasc);

0return_table:

createindexindex_sid_bidonreturn_table(stu_idasc,book_idasc);

mysqlcreateindexindex_sid_bid_ronreturn_table(stu_idasc,book_idasc);

0ticket:

createindexindex_sid_bidonticket(stu_idasc,book_idasc);

mysqlcreateindexindex_sid_bidonticket(stu_idasc,book_idasc);

0manager:

1.为manager_id创建索引:

createindexindex_midonmanager(manager_id);

mysqlcreateindexindex_midonmanager(manager_id);

04、设计视图、设计视图给出在各表上建立的视图以及使用的语句。

1.在表student上创建计算机专业(cs)学生的视图stu_cs:

createviewstu_csasselect*fromstudentwherepro=cs;

操作和结果:

mysqlcreateviewstu_csasselect*fromstudentwherestu_pro=cs;

QueryOK,0rowsaffected2.在表student,borrow和book上创建借书者的全面信息视图stu_borrow:

createviewstu_borrowasselectstudent.stu_id,book.book_id,student.stu_name,book.book_name,borrow_date,adddate(borrow_date,30)expect_return_datefromstudent,book,borrowwherestudent.stu_id=borrow.stu_idandbook.book_id=borrow.book_id;

mysqlcreateviewstu_borrowasselectstudent.stu_id,book.book_id,student.stu_name,book.book_name,borrow_date,adddate(borrow_date,30)expect_return_datefromstudent,book,borrowwherestudent.stu_id=borrow.stu_idandbook.book_id=borrow.book_id;

QueryOK,0rowsaffected3.创建类别1的所有图书的视图cs_book:

createviewcs_bookasselect*frombookwherebook.book_sortin(selectbook_sort.sort.namefrombook_sortwheresort_id=1);

操作和结果显示:

mysqlcreateviewcs_bookasselect*frombookwherebook.book_sortin(selectbook_sort.sort_namefrombook_sortwheresort_id=1);

QueryOK,0rowsaffected4.创建个人所有借书归还纪录视图stu_borrow_return:

createviewstu_borrow_returnasselectstudent.stu_id,student.stu_name,book.book_id,book.book_name,return_table.borrow_date,return_table.return_datefromstudent,book,return_tablewherestuden

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 天文地理

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1