基于SQL的数据库课程设计
1.图书销售统计
Create View OrderStat as
Select TOP 10 Book.ISBN , Lib.bName , Book.bClass , Book.bAuthor , Book.bPress , Lib.lNumber
From Book,Lib
Where Lib.bName=Book.bName
Order by Lib.lNumber DESC
2.图书退货统计
Create view RefundStat as
Select TOP 10 Book.ISBN,Lib.bName,Book.bClass,Book.bAuthor,Book.bPress,Refund.rNumber
From Book,Lib,Refund
Where Lib.bName=Book.bName and Refund.bName=Book.bName
Order by Refund.rNumber DESC
3.图书体日销售量统计
Create view DayStat as
select TOP 10 Orders.oDate as 日期 ,SUM(Orders.oNumber) as 数量
From Orders,Lib,Book
Where Lib.bName=Book.bName and Orders.bName=Book.bName
Group by Orders.oDate
Order by Orders.oDate ASC
4.库存信息量
Create view LibStat as
Select Book.ISBN,Lib.bName,Book.bClass,Book.bAuthor,Book.bPress,Lib.lNumber
From Lib,Book
Where Lib.bName=Book.bName
2022-06-27 15:06:33
70KB
数据库
SQL
1