云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 数据库设计大作业案例

数据库设计大作业案例

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 20:56:59

(BBno char (10) primary key not null, Bno char (10) not null, BBamount int(10) not null, Sno char (10) not null,

foreign key Sno references Student(Sno), foreign key Bno references Book(Bno) )

(3)教材库表:图书管理员,库号,书号,库存量 create table StackRoom (SRmanager char (10) not null, SRno char (10) not null, Bno char (10) not null, SRamount int(10) not null, primary key (SRno, SRmanager), foreign key Bno references Book(Bno) )

(4)教材表:书号,书名,单价,出版社 create table Book

(Bno char (10) primary key not null, Bname char (30) not null, Bprice char (10) not null, Pno char (10) not null,

foreign key Pno references Public(Pno) )

(5)出版社表: create table Public

(Pno char (10) primary key not null, Pname char (30) not null, Pphone char (30) not null, Padd char (30) not null,

9

)

3.2 数据载入

图4-1 学生表数据

图4-2 购书单表数据

图4-3教材库表数据

图4-4教材表数据

10

图4-5出版社表数据

.运行

(1)各班学生用书表:班级、书号、书名、购买数量 select distinct Sclass,Book.Bno,Bname,BBamount from Student,BuyBook,Book where BuyBook.Sno=Student.Sno and BuyBook.Bno=Book.Bno

图5-1各班学生用书表

(2)售书登记表:学号、姓名、书号、购买数量 select Student.Sno,Sname,Bno,BBamount from Student,BuyBook

where BuyBook.Sno=Student.Sno

图5-2售书登记表

(3)缺书登记表:学号、姓名、书号、缺书数量

select Student.Sno,Student.Sname,BuyBook.Bno,BBamount-SRamount amount from Student,BuyBook,StackRoom,Book

11

4

where BuyBook.Sno=Student.Sno and BuyBook.Bno=StackRoom.Bno and Book.Bno=BuyBook.Bno and

BuyBook.BBamount>StackRoom.SRamount

图5-2缺书登记表

教材存量表:书号、单价、库存量 select Book.Bno,Bprice,SRamount from Book,StackRoom,BuyBook where Book.Bno=StackRoom.Bno and Book.Bno=BuyBook.Bno

图5-4教材存量表

待购教材表:书号、缺书数量

select BuyBook.Bno,BBamount-SRamount amount from BuyBook,StackRoom

where BuyBook.Bno=StackRoom.Bno and BuyBook.BBamount >StackRoom.SRamount

图5-5待购教材表

12

(4)(5)

搜索更多关于: 数据库设计大作业案例 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

(BBno char (10) primary key not null, Bno char (10) not null, BBamount int(10) not null, Sno char (10) not null, foreign key Sno references Student(Sno), foreign key Bno references Book(Bno) ) (3)教材库表:图书管理员,库号,书号,库存量 create table StackRoom (SRmanager char (10) not null, SRno char (10) not null, Bno char (10) not null, SRamount int(10) not null, primary key (SRno

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com