1、 画出系统功能模块图并用文字对各功能模块进行详细介绍。系统功能模块图:三、数据库设计方案图表 1、系统E-R模型总体E-R图:精细化的局部E-R图:学生借阅-归还E-R图:管理员E-R图: 2、设计表 给出设计的表名、结构以及表上设计的完整性约束。student:列名数据类型是否为空/性质说明stu_idintnot null /PK标明学生唯一学号stu_namevarcharnot null学生姓名stu_sex学生性别stu_age学生年龄stu_pro学生专业stu_grade学生年级stu_integritynot null/default=1学生诚信级book:book_idnot
2、 null / PK唯一书籍序号book_name书籍名称book_author书籍作者book_pub书籍出版社book_numint not null 书籍是否在架上book_sort书籍分类book_recorddatatimenull书籍登记日期book_sort:sort_id类型编号sort_name类型名称borrow:存储学生的借书信息student_id学生编号varchar 书籍编号borrow_date借书时间expect_return_datedatetime预期归还时间return_table:存储学生的归还信息return_date实际还书时间ticket:存储学生
3、的罚单信息over_date超期天数ticket_feefloat处罚金额manager:manager_id管理员编号manager_name管理员姓名manager_age管理员年龄manager_phone管理员电话 3、设计索引给出在各表上建立的索引以及使用的语句。1.为stu_id创建索引,升序排序sql:create index index_id on student(stu_id asc);2.为stu_name创建索引,并且降序排序alter table student add index index_name(stu_name, desc);插入索引操作和结果如下所示:mys
4、ql create index index_id on student(stu_id asc);Query OK, 0 rows affectedRecords: 0 Duplicates: 0 Warnings: 0 alter table student add index index_name(stu_name desc);1.为book_id创建索引,升序排列create index index_bid on book(book_id);2.为book_record创建索引,以便方便查询图书的登记日期信息,升序:create index index_brecord on book(bo
5、ok_record);插入索引的操作和结果如下所示: create index index_bid on book(book_id); create index index_brecord on book(book_record);1.为stu_id和book_id创建多列索引:create index index_sid_bid on borrow(stu_id asc, book_id asc); create index index_sid_bid on borrow(stu_id asc, book_id asc);create index index_sid_bid on retur
6、n_table(stu_id asc, book_id asc); create index index_sid_bid_r on return_table(stu_id asc, book_id asc);1. 为stu_id和book_id创建多列索引:create index index_sid_bid on ticket(stu_id asc, book_id asc); create index index_sid_bid on ticket(stu_id asc, book_id asc);1.为manager_id创建索引:create index index_mid on ma
7、nager(manager_id); create index index_mid on manager(manager_id); 4、设计视图 给出在各表上建立的视图以及使用的语句。1.在表student上创建计算机专业(cs)学生的视图stu_cs: create view stu_cs asselect *from studentwhere pro = cs;操作和结果: create view stu_cs aswhere stu_pro = cs;2. 在表student, borrow和book上创建借书者的全面信息视图stu_borrow: create view stu_bor
8、row asselect student.stu_id, book.book_id, student.stu_name, book.book_name, borrow_date,adddate(borrow_date,30) expect_return_datefrom student, book, borrowwhere student.stu_id = borrow.stu_id and book.book_id = borrow.book_id;3.创建类别1的所有图书的视图cs_book: create view cs_book asfrom bookwhere book.book_sort in(select book_sort.sort.namefrom book_sortwhere s
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1