当前位置:首页 » 数据仓库 » 数据库习题
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

数据库习题

发布时间: 2022-02-17 23:21:20

数据库练习题

答案如下:

② 数据库试题

1/A
2/B
3/A
4/A
5/B
6/C
7/数据结构,数据操作,完整性约束条件
8/表
9/DBA
10/数据独立性差
11/SQL
12/内模式
13/存储
14/外模式,模式和内模式
15/应用程序,操作系统,数据库管理系统
16/数据库管理系统
17/增删改查
18/实体,属性和联系
19/A
20/属性
欢迎批评指正。

③ 数据库练习题。

前2题很简单同上, 网页不让我贴上去. 呵呵 ^_^3. select 图书表.书名 , 借阅表.借书日期 from 读者表 , 借阅表 , 图书表 where 读者表.姓名 =“李%” and 借阅表.借书证号 = 读者表.借书证号 and 借阅表.总编号 = 图书表.总编号4. select 借阅表.借书证号 from 图书表 , 借阅表 where 借阅表.总编号 = 图书表.总编号 and 书名 = "SQL Server大全"5. select 读者表.姓名 , 读者表.所在单位 , 借阅表.借书日期 from 读者表 , 借阅表 where 借阅表.借书日期 = (select 借阅表.借书日期 from 读者表 , 借阅表 where 读者表.姓名 = "赵正义" and 借阅表.借书证号 = 借阅表.借书证号) and 借阅表.借书证号 = 借阅表.借书证号 给你参考了5题了 希望你能在其中找到解决问题的途径剩下的那题希望通过努力你自己能完成,那样你就有进步了.

④ 数据库习题

10、D
11、C
12、A
13、B
14、AB
15、B
16、A
17、D没有给出,但排除法的话选D

⑤ 数据库练习题

创建一个选择查询,按系别统计各自男女学生的平均年龄

SELECT
系,
性别,
AVG(年龄) AS 平均年龄
FROM

GROUP BY
系,
性别

上面是用 SQL 的处理方法。

楼主要求 “最好不是SQL啊”, 不知道楼主 希望是用什么?

一步一步操作?
那要说明是什么数据库啊.
如果是 Access的话, 操作顺序是这样的:

1、创建一个查询
2、在《显示表》窗口里面,把那个表 选中,按 添加按钮。
3、关闭《显示表》窗口, 进入设计窗口。
4、在表中,双击 系, 性别, 年龄 这3列, 加到下面的列表中。
5、在下面列表的地方,鼠标右键,在弹出窗口,选择 “汇总”
6、修改 年龄下面的 Group By, 变成 “计算” 注意,不是“总计”。
7、运行查询。

⑥ 数据库题目

1、 查和“S0701026”读者借了相同图书的读者的图书证号和姓名 select rno,rn from reader where rno in(select a.rno from borrow as a,borrow as b where a.bno=b.bno and b.rno='S0701026') 2、 查询每个读者的姓名和所借图书名 select rn,bn from reader,borrow,book where reader.rno=borrow.rno and borrow.bno=book.bno 3、 查没有借书的读者的图书证号和姓名 select rno,rn from reader where rno not in(select rno from borrow) 4、 查询借阅了“数据结构”的读者数量 select count(*) from borrow where bno=(select bno from book where bn='数据结构') group by bno 5、 查“李丽”和“张朝阳”都借阅了的图书的书号 select a.bno from borrow as a,borrow as b where a.rno=(select rno from reader where rn='李丽') and b.rno=(select rno from reader where rn='张朝阳') and a.bno=b.bno 6、 查询借书上限最大的读者信息 select * from reader where rup=(select max(rup) from reader) order by rup desc 7、 查询借阅图书数量达到2本的读者信息 select * from reader where rno in(select rno from borrow group by rno having count(*)>1) 8、 查询每个读者姓名,所借图书的图书号,没有借书的读者也列出来 select reader.rn,bno from reader left join borrow on reader.rno=borrow.rno 9、 查询没有借阅“C程序设计”的读者姓名 select rn from reader where rno not in(select rno from borrow where bno=(select bno from book where bn='C程序设计')) 10、 检索所有姓李的读者所借图书的书号 select bno from borrow where rno in(select rno from reader where rn like '李%') 11、 查被借出的图书编号以“TP”开头的图书信息 select * from book where bno in(select bno from borrow where bno like 'TP%') 12、 查没有被借阅的图书信息 select * from book where bno not in(select bno from borrow) 13、 查询借阅了“数据库原理及其应用教程”的读者的图书证号和姓名 select reader.rno,rn from reader,borrow,book where reader.rno=borrow.rno and borrow.bno=book.bno and bn='数据库原理及其应用教程' 14、 统计各个系读者的数量,显示系名和数量 select rde 系名,count(*) 数量 from reader group by rde 15、 查询有过期未还图书的读者的书号、姓名、所在系 select bno,rn,rde from reader,borrow where reader.rno=borrow.rno and rda < getdate() 16、 检索至少借阅了“数据结构”和“操作系统教程”的读者图书证号 select a.rno from borrow as a,borrow as b where a.bno=(select bno from book where bn='数据结构') and b.bno=(select bno from book where bn='操作系统教程') and a.rno=b.rno 17、 查库存书的总数 select sum(bnu) from book 18、 查询借阅了图书的读者信息 select * from reader where rno in(select rno from borrow)