下载此文档

《数据查询》练习的答案.doc


文档分类:IT计算机 | 页数:约3页 举报非法文档有奖
1/3
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/3 下载此文档
文档列表 文档介绍
学生表“Student”中查询出男生的学号、姓名、性别的数据信息。selectSID,Sname,SexfromStudentwhereSex='男'学生表“Student”中查询出前20%的数据行selecttop20percentSID,Sname,Sex,BirthdayfromStudent学生表“Student”中查询出学校各专业的名称(不允许出现重复字段)selectdistinctspecialtyfromStudent学生表“Student”中查询出学生赵成刚的信息。select*fromStudentwhereSname='赵成刚'学生表“Student”中查询出男生的信息。select*fromStudentwhereSex='男'学生表“Student”中查询出在‘1985-12-1’之前出生的学生的信息select*fromStudentwhereBirthday<'1985-12-1'学生表“Student”中查询出在‘1985-12-1’之前出生的女学生的信息select*fromStudentwhereBirthday<'1985-12-1'andSex='女'学生表“Student”中查询姓“李”的学生信息select*fromStudentwhereSnamelike'李%'学生表“Student”中查询学号为2005216007和2006216578的学生信息select*fromStudentwhereSID=2005216007orSID=200621657学生表“Student”中查询出各专业的学生总数,要求查询结果显示专业名称和人数两个列selectspecialty,count(*)as人数fromStudentgroupbyspecialty学生表“Student”中查询出各专业的学生总数,要求显示专业人数>4的专业名称和人数selectspecialty,count(*)as人数fromStudentgroupbyspecialtyhavingcount(*)>4在图书管理数据库“Library”中进行操作:图书表“book”中查询出前5行数据。selecttop5bid,bname,authorfrombook读者类型表“ReaderType”中查询出所有数据。select*fromReaderType图书表“book”中查询出所有图书折价90%后的价格selectbid,bname,author,p,price,price*“book”中统计出高等教育出版社出版的图书数量(使用count())selectcount(*)p='高等教育出版社'图书表“book”中统计各出版社的个数(每个出版社只计数一次)selectcount(distinct(p))as出版社个数frombook图书表“book”中查询出图书的总册数、最高价、最低价、总价值、折扣后的总价值和评价价selectcount(price)as册数,max(price)as最高价,min(price)as最低价,sum(price)as总价值,sum(price*)as折价后的总价值,avg(price)as平均价frombook图书表“book”中查询定价在10元到15元之间的图书信息。

《数据查询》练习的答案 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数3
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xunlai783
  • 文件大小28 KB
  • 时间2019-05-19