网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

BookStore数据库中有销售明细表OrderDetail(OrderCode,BookCode,Amount)查询销售总量前20%的图书,并按总销量降序排列。SQL语句:SELECT TOP 20 PERCENT Bookcode As书号,SUM(Amount)As总销量ROMOrderDetail GROUP BY Book code ORDER BY()

  • A、AmountDESC
  • B、SUM(Amount)DESC
  • C、COUNT(Amount)DESC
  • D、ADD(Amount)DESC

参考答案

更多 “BookStore数据库中有销售明细表OrderDetail(OrderCode,BookCode,Amount)查询销售总量前20%的图书,并按总销量降序排列。SQL语句:SELECT TOP 20 PERCENT Bookcode As书号,SUM(Amount)As总销量ROMOrderDetail GROUP BY Book code ORDER BY()A、AmountDESCB、SUM(Amount)DESCC、COUNT(Amount)DESCD、ADD(Amount)DESC” 相关考题
考题 假设每个歌手的“最后得分”的计算方法是:去掉一个最高分和一个最低分,取剩下分数的平均分。根据“评分”表求每个歌手的“最后得分”并存储于表TEMP中,表 TEMP中有两个字段:“歌手号”和“最后得分”,并且按最后得分降序排列,生成表 TEMP的SQL语句是 ______。A.SELECT歌手号,(COUNT(分数)-MAX(分数)-MIN(分数)/SUM(*)-2)最后得分; FROM评分INTO DBF TEMP GROUP BY歌手号ORDER BY最后得分DESCB.SELECT歌手号,(COUNT(分数)-MAX(分数)-MIN(分数)/(SUM(*)-2)最后得分; FROM评分INTO DBF TEMP GROUP BY评委号ORDER BY最后得分DESCC.SELECT歌手号,(SUM(分数)-MAX(分数)-MIN(分数)/COUNT(*)-2)最后得分; FROM评分INTO DBF TEMP GROUP BY评委号ORDER BY最后得分DESCD.SELECT歌手号,(SUM(分数)-MAX(分数)-MIN(分数)/COUNT(*)-2)最后得分; FROM评分INTO DBF TEMP GROUP BY歌手号ORDER BY最后得分DESC

考题 检索选修四门以上课程的学生总成绩(不统计不及格的课程),并要求按总成绩降序排列出来,正确的SELECT语句是______。A.SELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 CROUP BY S# ORDER BY 2 DESC HAVING COUNT(*)>=4B.SELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 GROUP BY S# HAVING COUNT(*)>=4 ORDER BY 2 DESCC.SELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 HAVING COUNT(*)>=4 GROUP BY S# ORDER BY 2 DESCD.DELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 ORDER BY 2 DESC CROUP BY S# HAVING COUNT(*)>=4

考题 对于图书管理数据库,要查询所藏图书中,各个出版社的图书最高单价、平均单价和册数,下面SQL语句正确的是______。 SELECT出版单位,______,______,______; FROM图书管理!图书______出版单位A.MIN(单价) AVGAGE(单价) COUNT(*) GROUP BYB.MAX(单价) AVG(单价) COUNT(*) ORDER BYC.MAX(单价) AVG(单价) SUM(*) ORDER BYD.MAX(单价) AVG(单价) COUNT(*) GROUP BY

考题 deficit is the amount by which a sum of money falls short of the required or expected amount.()

考题 若需在“参赛队”表中按降序排列查询前3名的队伍,下列语法正确的是______。A.SELECT队名,积分TOP 3 FROM参赛队; ORDER BY积分DESCB.SELECT队名,积分TOP 3 PERCENT FROM参赛队; ORDER BY积分DESCC.SELECT队名,积分TOP 3 FROM参赛队DESC;D.SELECT队名,积分TOP 3 PERCENT FROM参赛队DESC

考题 对于图书管理数据库,要查询所藏图书中各个出版社的图书最高单价、平均单价和册数,下面SQL语句正确的是______。 SELECT 出版单位,______,______,______; FROM 图书______出版单位A.MIN(单价)AVGAGE(单价)COUNT(*)GROUP BYB.MAX(单价)AVG(单价)COUNT(*)ORDER BYC.MAX(单价)AVG(单价)SUM(*)ORDER BYD.MAX(单价)AVG(单价)COUNT(*)GROUP BY

考题 在成绩表中要求按“总分”降序排列,并查询前3名学生的记录,正确的命令是A.SELECT * TOP 3 FROM成绩表; WHERE总分DESCB.SELECT * TOP 3 FROM成绩表; FOR总分DESCC.SELECT * TOP 3 FROM成绩表; GROUP BY总分DESCD.SELECT * TOP 3FROM成绩表; ORDER BY总分DESC

考题 在成绩表中要求按“物理”降序排列,并查询前两名的学生姓名,正确的语句是( )。A.SELECT 姓名 TOP 2 FROM 成绩表 WHERE 物理 DESCB.SELECT 姓名 TOP 2 FROM 成绩表 FOR 物理 DESCC.SELECT 姓名 TOP 2 FROM 成绩表 GROUP BY 物理 DESCD.SELECT 姓名 TOP 2 FROM 成绩表 ORDER BY 物理 DESC

考题 若需在“选课”表中按降序排列查询前3名的学生,下列语法正确的是( )。A.SELECT 学生号,成绩 TOP 3 FROM 选课; ORDER BY 成绩 DESCB. SELECT 学生号,成绩 TOP 3 PERCENT FROM 选课: ORDER BY 成绩 DESCC.SELECT 学生号,成绩 TOP 3 FROM 选课 DESC:D. SELECT 学生号,成绩 TOP 3 PERCENT FROM 选课 DESC

考题 下面 3~6 题使用如下的“外汇名”表和“持有数”表:第 3 题 查询持有外币种类在4种以上人员的姓名,及持有的种类数量,并按种类数量升序排列,数量相同时,则按姓名降序排列,下列语句正确的是( )。A)SELECT姓名,COUNT(﹡)AS外币种类FROM持有数;GROUP BY姓名HAVING COUNT(﹡)=4;ORDER BY外币种类,姓名DESCB)SELECT姓名,COUNT(﹡)AS外币种类FROM持有数;GROUP BY姓名HAVING COUNT(﹡)=4;ORDER BY COUNT(﹡),姓名DESCC)SELECT姓名,COUNT(﹡)AS外币种类FROM持有数;GROUP BY姓名HAVING COUNT(﹡)=4;ORDERBY外币种类AND姓名DESCD)SELECT姓名,COUNT(﹡)AS外币种类FROM持有数;GROUP BY姓名HAVING COUNT(﹡)=4:ORDER BY外币种类+姓名DESC

考题 在成绩表中要求按“物理”降序排列,并查询前两名的学生姓名,正确的命令是( )。A.SELECT姓名TOP 2 FROM成绩表WHERE物理DESCB.SELECT姓名TOP 2 FROM成绩表FOR物理DESCC.SELECT姓名TOP 2 FROM成绩表GROUP BY物理DESCD.SELECT姓名TOP 2 FROM成绩表ORDER BY物理DESC

考题 查询持有外币种类在4种以上人员的姓名及持有的种类数量,并按种类数量升序排列,数量相同时,则按姓名降序排列,下列语句正确的是( )。A.SELECT姓名,COUNT(*)AS外币种类FROM持 有数 GROUP BY姓名HAVING COUNT(*)=4ORDER BY外币种类,姓名DESCB.SELECT姓名,COUNT(*)AS外币种类FROM持 有数 GROUP BY姓名HAVING COUNT(*)V40RDER BY COUNT(*),姓名DESCC.SELECT姓名,cUNT(*)AS外币种类FROM持 有数 GROUP BY姓名HAVING COUNT(*)=4ORDER BY外币种类AND姓名DESCD.SELECT姓名,COUNT(*)AS外币种类FROM持 有数 GROUP BY姓名HAVING COUNT(*)=4 ORDER BY外币种类+姓名DESC

考题 查询持有外币种类在4种以上人员的姓名,及持有的种类数量,并按种类数量升序排列,数量相同时,则按姓名降序排列,下列语句正确的是( )。A.SELECT 姓名,COUNT(*) AS 外币种类 FROM 持有数; GROUP BY 姓名 HAVING COUNT(*)>=4; ORDER BY 外币种类,姓名 DESCB.SELECT 姓名,COUNT(*) AS 外币种类 FROM 持有数; GROUP BY 姓名 HAVING COUNT(*)>=4; ORDER BY COUNT(*),姓名 DESCC.SELECT 姓名,COUNT(*) AS 外币种类 FROM 持有数; GROUP BY 姓名 HAVING COUNT(*)>=4; ORDER BY 外币种类 AND 姓名 DESCD.SELECT 姓名,COUNT(*) AS 外币种类 FROM 持有数; GROUP BY 姓名 HAVING COUNT(*)>=4; ORDER BY 外币种类+姓名 DESC

考题 你是某销售组织的数据库开发人员, 你的数据库有一个名为Sales表, 此表包括了来自销售人员的销售订单概要信息.销售经理要求你创建一个销售额排在前20位的销售人员报表, 你该使用哪个查询来完成这个任务( ) A、 SELECT TOP 20 PERCENT LastName, FirstName, SUM (OrderAmount) AS ytdFROM salesGROUP BY LastName, FirstNameORDER BY 3 DESCB、 SELECT LastName, FirstName, COUNT(*) AS salesFROM salesGROUP BY LastName, FirstNameHAVING COUNT (*) >20ORDER BY 3 DESCC、 SELECT TOP 20 LastName, FirstName, MAX(OrderAmount) AS ytdFROM salesGROUP BY LastName, FirstNameORDER BY 3 DESCD、 SELECT TOP 20 LastName, FirstName, SUM (OrderAmount) AS ytdFROM salesGROUP BY LastName, FirstNameORDER BY 3 DESC

考题 检索选修四门以上课程的学生总成绩(不统计不及格的课程),并要求按总成绩的降序排列出来。正确的SELECT语句是______。A.SELECT S#, SUM(GRADE) FROM SC WHERE GRADE>=60 GROUP BY S# ORDER BY 2 DESC HAVING COUNT(*)>=4B.SELECT S#, SUM(GRADE) FROM SC WHERE GRADE>=60 GROUP BY S# HAVING COUNT(*)>=4 ORDER BY 2 DESCC.SELECT S#, SUM(GRADE) FROM SC WHERE GRADE>=60 HAVING COUNT(*)>=4 GROUP BY S# ORDER BY 2 DESCD.SELECT S#, SUM(GRADE)FROM SC WHERE GRADE>=60 ORDER BY 2 DESC GROUP BY S# HAVING COUNT(*)>=4

考题 设在SQL Server2008某数据库中有图书表(书号,书名,出版日期,单价),其中“书号”是主码。现要查询2015年1月份出版的单价最高的前三本图书的详细信息。下列查询语句中能正确完成该查询要求的是( )。 A.SELECT*TOP 3 FROM图书表WHERE出版Et期BETWEEN’2015/1/1′AND′2015/1/31′ORDER BY单价DESCB.SELECT TOP 3幸FROM图书表WHERE出版日期BETWEEN#2015/1/1#AND#2015/1/31#ORDER BY单价DESCC.SELECT TOP 3*FROM图书表WHERE出版日期BETWEEN’2015/1/1′AND′2015/1/31′ORDER BY单价DESCD.SELECT木TOP 3 FROM图书表WHERE出版日期BETWEEN#2015/1/1#AND#2015/1/31#ORDER BY单价DESC

考题 BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime查询作者名长度大于等于8的图书信息,显示书名(BookName)及作者(Author)。SQL语句:SELECTBookName,AuthorFROMBookWHERELenth(Author)=8

考题 BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime,PublishTime是datetime类型。查询Book表中的图书类别(BookSort),要求每个类别只显示一次。SQL语句:SELECT()BookSort FROM BookA、DISTINCTB、ONLYC、ONED、PERCENT

考题 BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime查询图书名称(BookName)含有“程序”的图书信息。SQL语句:SELECTBookCode,BookName,Author,Price,DiscountFROMBookWHEREName=“%程序%”

考题 下列查询年龄最大的前四个学生(包括并列的情况)的语句,正确的是()。A、SELECT TOP 4 WITH TIES * FROM Student ORDER BY Sage ASCB、SELECT TOP 4 WITH TIES * FROM Student GROUP BY Sage ASCC、SELECT TOP 4 WITH TIES * FROM Student ORDER BY Sage DESCD、SELECT TOP 4 WITH TIES * FROM Student GROUP BY Sage DESC

考题 在GZ表中选出职称为“工程师”的记录,并按年龄的降序排列,则实现的SQL语句为()A、SELECT FROM GZ for 职称=工程师 ORDER BY 年龄/DB、SELECT FROM GZ WHERE职称=工程师 ORDER BY 年龄 DESCC、SELECT * FROM GZ WHERE职称=‟工程师‟ ORDER BY 年龄 DESCD、SELECT * FROM GZ WHERE职称=‟工程师‟ ORDER ON 年龄 DESC

考题 假设订单表orders用来存储订单信息,cid代表客户编号,money代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,下面()sql语句可以返回正确结果。A、select cid,count(distinct(cid)),sum(money) from orders group by cidB、select cid,count(distinct(cid)),sum(money) from orders order by cidC、select cid,count(cid),sum(money) from orders order by cidD、select cid,count(cid),sum(money) from orders group by cid

考题 判断题BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime查询作者名长度大于等于8的图书信息,显示书名(BookName)及作者(Author)。SQL语句:SELECTBookName,AuthorFROMBookWHERELenth(Author)=8A 对B 错

考题 判断题BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime查询图书名称(BookName)含有“程序”的图书信息。SQL语句:SELECTBookCode,BookName,Author,Price,DiscountFROMBookWHEREName=“%程序%”A 对B 错

考题 多选题BookStore数据库中有销售明细表OrderDetail(OrderCode,BookCode,Amount)在OrderDetail表中添加一条记录:“08110801”、0701、3。SQL语句:()AINSERT INTOOrderDetail(OrderCode,Amount,BookCode)VALUES(‘08110801’,3,’0701’)BINSERT INTOOrderDetail(OrderCode,Amount,BookCode)VALUES(‘08110801’,’0701’,3)CINSERT INTOOrderDetail(OrderCode,BookCode,Amount)VALUES(‘08110801’,’0701’,3)DINSERT INTOOrderDetailVALUES(‘08110801’,’0701’,3)

考题 单选题BookStore数据库中有图书表Book(BookCode,BookName,Author,PublisherCode,PublishTime,PublishTime是datetime类型。查询Book表中的图书类别(BookSort),要求每个类别只显示一次。SQL语句:SELECT()BookSort FROM BookA DISTINCTB ONLYC ONED PERCENT

考题 单选题BookStore数据库中有销售明细表OrderDetail(OrderCode,BookCode,Amount)查询销售总量前20%的图书,并按总销量降序排列。SQL语句:SELECT TOP 20 PERCENT Bookcode As书号,SUM(Amount)As总销量ROMOrderDetail GROUP BY Book code ORDER BY()A AmountDESCB SUM(Amount)DESCC COUNT(Amount)DESCD ADD(Amount)DESC