Sql 语句答案:
1. select姓名,单位
from读者
where姓名like'李%'
2. select书名,出版单位
from图书
3. select出版单位,书名,单价
from图书
where出版单位='高等教育出版社'
order by单价desc
4. select书名,出版单位,单价
from图书
where单价between 10.00 and 20.00
order by出版单位,单价asc
5. select书名,作者
from图书
where书名like'计算机%'
6. select借阅.总编号,借书证号
from图书,借阅
where图书.总编号=借阅.总编号and借阅.总编号in('112266','449901')
7.select distinct姓名,单位
from读者inner join借阅
on借阅.借书证号=读者.借书证号
8. select书名,姓名,借书日期
from图书inner join借阅
on图书.总编号=借阅.总编号
join读者
on借阅.借书证号=读者.借书证号
where读者.姓名like'李%'
9. select distinct读者.借书证号,姓名,单位
from借阅inner join读者
on借阅.借书证号=读者.借书证号
where借阅.借书日期>='1997-10-1'
10. select借书证号
from借阅
where总编号in(select总编号
from图书
where书名='FoxPro大全')
11. select姓名,单位,借书日期
from借阅,读者
where借阅.借书证号=读者.借书证号and借书日期=(select借书日期
from借阅,读者
where借阅.借书证号=读者.借书证号and姓名='赵正义')
12. select distinct借书证号,姓名,单位
from读者
where借书证号not in(select借书证号
from借阅
where借书日期>='1997-07-01')
13. select max(单价)最高单价,min(单价)as最低单价,avg(单价)as平均单价from图书
where出版单位='科学出版社'
14. select count(借书证号)
from借阅
where借书证号in(select借书证号
from读者
where单位='信息系')
15. select出版单位,max(单价)最高价格,min(单价)as最低价格,count(*)册数from图书
group by出版单位
16. select单位,count(借阅.借书证号)
from借阅,读者
where借阅.借书证号in(select借书证号
from读者)
group by单位
17. select姓名,单位
from读者
where借书证号in(select借书证号
from借阅
group by借书证号
having count(*)>=2)
18. select单位,count(*)as超过人次
from借阅,读者
where读者.借书证号=借阅.借书证号
group by单位
having count(*)>=2
19. select出版单位,count(*)册数,sum(单价)总价
from图书
group by出版单位
20. select姓名,单位,职称
from读者
where单位='经济系'and not exists(select*
from读者,借阅
where读者.借书证号=借阅.借书证号and单位='经济系')。