网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
设ABC表有三列A、B、C,并且都是整数类型,则以下( )查询语句能够按照B列进行分组,并在每一组中取C的平均值。
A select avg(C) from ABC
B select avg(C) from ABC order by B
C select avg(C) from ABC group by B
D select avg(C) from ABC group by C, B
参考答案
更多 “ 设ABC表有三列A、B、C,并且都是整数类型,则以下( )查询语句能够按照B列进行分组,并在每一组中取C的平均值。 A select avg(C) from ABCB select avg(C) from ABC order by BC select avg(C) from ABC group by BD select avg(C) from ABC group by C, B ” 相关考题
考题
关系SC(Sno,Cno,Grade)表示学号,课程号,成绩。现要查询平均分在90分以上的学生的学号和平均成绩,正确的语句是______。A.SELECT Sno,AVG(Grade) FROM SC WHERE AVG(Grade)>=90 GROUP BY SnoB.SELECT Sno,AVG(Grade) FROM SC GROUP BY Sno HAVING AVG(Grade)>=90C.SELECT Sno,AVG(Grade) FROM SC WHERE AVG(Grade)>=90 ORDER BY SnoD.SELECT Sno,AVG(Grade) FROM SC GROUP BY Cno HAVING AVG(Grade)>=90
考题
有学生表(学号,姓名,所在系,年龄),找出系内学生平均年龄高于全体学生平均年龄的系信息,正确的语句是______。A.SELECT所在系,AVG(年龄)FROM学生表 WHERE AVG(年龄)>(SELECT AVG(年龄)FEOM学生表)B.SELECT所在系,AVG(年龄)FROM学生表 WHERE AVG(年龄)>(SELECT AVG(年龄)FEOM学生表) GROUP BY所在系C.SELECT所在系,AVG(年龄)FROM学生表 GROUP BY所在系 HAVING AVG(年龄)>(SELECT AVG(年龄)FEOM学生表)D.SELECT所在系,AVG(年龄)FROM学生表 GROUP BY所在系 WHERE AVG(年龄)>(SELECT AVG(年龄)FEOM学生表)
考题
有教师表(教师号,姓名,所在系,工资),找出系内教师平均工资高于全体教师平均工资的系信息,正确的语句是______。A.SELECT所在系,AVG(工资)FROM教师表 WHERE AVG(工资)(SELECT AVG(工资)FEOM教师表)B.SELECT所在系,AVG(工资)FROM教师表 WHERE AVG(工资)(SELECT AVG(工资)FEOM教师表) GROUP BY所在系C.SELECT所在系,AVG(工资)FROM教师表 GROUP BY所在系 HAVING AVG(工资)(SELECT AVG(工资)FEOM教师表)D.SELECT所在系,AVG(工资)FROM教师表 GROUP BY所在系 WHERE AVG(工资)(SELECT AVG(工资)FEOM教师表)
考题
有教师表(教师号,姓名,所在系,工资),找出系内教师平均工资高于全体教师平均工资的系,正确的语句是______。A)SELECT所在系,AVG(工资)FROM教师表WHERE AVG(工资)>(SELECT AVG(工资)FROM教师表)B)SELECT所在系,AVG(工资)FROM教师表WHERE AVG(工资)>(SELECT AVG(工资)FROM教师表)GROUP BY所在系C)SELECT所在系,AVG(工资)FROM教师表GROUP BY所在系HAVING AVG(工资)>(SELECT AVG(工资)FROM教师表)D)SELECT所在系,AVG(工资)FROM教师表GROUP BY所在系WHERE AVG(工资)>(SELECT AVG(工资)FROM教师表)A.B.C.D.
考题
求每个终点的平均票价的SQL语句是A)SELECT终点,avg(票价)FROM ticket GROUP BY票价B)SELECT终点,avg(票价)FROM ticket ORDER BY票价C)SELECT终点,avg(票价)FROM ticket ORDER BY终点D)SELECT终点,avg(票价)FROM ticket GROUP BY终点
考题
有教师表 ( 教师号 , 姓名 , 所在系 , 工资 ) , 找出系内教师平均工资高于全体教师平均工资的系信息 ,正确语句是A )SELECT 所在系 , AVG( 工资 ) FORM. 教师表WHERE AVG( 工资 )(SELECT AVG( 工资 ) FROM 教师表 )B )SELECT 所在系 , AVG( 工资 )FROM 教师表WHERE AVG( 工资 )(SELECT AVG( 工资 ) FROM 教师表 ) GROUP BY 所在系C )SELECT 所在系 , AVG( 工资 ) FROM 教师表GROUP BY 所在系 HAVING AVG( 工资 )(SELECT AVG( 工资 ) FROM 教师表 )D )SELECT 所在系 , AVG( 工资 ) FROM 教师表 GROUPBY 所在系WHERE AVG( 工资 )(SELECT AVG( 工资 ) FROM 教师表 )
考题
假设同一名称的课程有不同的学生选修和不同的老师教授,则计算每门课程的平均分的SQL语句是( )。A)SELECT课程名称,AVG(成绩)FROM课程GROUP BY成绩B)SELECT课程名称,AVG(成绩)FROM课程ORDER BY成绩C)SELECT课程名称,AVG(成绩)FROM课程ORDER BY课程名称D)SELECT课程名称,AVG(成绩)FROM课程GROUP BY课程名称
考题
求每个终点的平均票价的SQL语句是A.SELECT终点,avg(票价)FROM ticket GROUP BY票价B.SELECT终点,avg(票价)FROM ticket ORDER BY票价C.SELECT终点,avg(票价)FROM ticket ORDER BY终点D.SELECT终点,avg(票价)FROM ticket GROUP BY终点
考题
假设 “ 订单 ” 表中有订单号、职员号、客户号和金额字段,正确的 SQL 语句只能是A)SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)3 AND AVG_ 金额 200B)SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)3 AND AVG( 金额 )200C)SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)3 WHERE AVG( 金额 )200D)SELECT 职员号 FROM 订单 GROUP BY 职员号 WHERE COUNT(*)3 AND AVG_ 金额 200
考题
假设同一名称的产品有不同的型号和产地,则计算每种产品平均单价的 SQL 语句是A)SELECT 产品名称 ,AVG( 单价 ) FROM 产品 GROUP BY 单价B)SELECT 产品名称 ,AVG( 单价 ) FROM 产品 ORDER BY 单价C)SELECT 产品名称 ,AVG( 单价 ) FROM 产品 ORDER BY 产品名称D)SELECT 产品名称 ,AVG( 单价 ) FROM 产品 GROUP BY 产品名称
考题
根据SQL标准,要查询表student中平均年龄age小于21的所在系dept及其平均年龄值,下面哪条语句适用?()A select dept,avg(age) from student where avg(age)B select dept,avg(age) from student group by dept having avg(age)C select dept,avg(age) from student having avg(age)D select dept,avg(age) from student group by dept where avg(age)
考题
Examine the data in the EMPLOYEES table:Which three subqueries work? ()
A. SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);C. SELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);D. SELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);E. SELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);F. SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));
考题
Click the Exhibit button and examine the data in the EMPLOYEES table.Which three subqueries work? ()
A.SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department_id);B.SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);C.SELECT distinct department_id FROM employees WHERE salary ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);D.SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);E.SELECT last_name FROM employees WHERE salary ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);F.SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));
考题
下图是使用查询设计器完成的查询,与该查询等价的SQL语句是( )。A.select学号,数学from sc where数学(selectavg(数学) from sc)B.select学号where数学(select avg(数学) from sc)C.select数学avg(数学) from scD.select数学(select avg(数学) from sc)
考题
查询订单数在3个以上、订单的平均金额200元以上的职员号。正确的SQL语句是A.SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)>3 AND AVG 金额>200B.SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)>3 AND AVG (金额)>200C.SELECT 职员号 FROM 订单 GROUP BY 职员号 HAVING COUNT(*)>3 WHERE AVG (金额)>200D.SELECT 职员号 FROM 订单 GROUP BY 职员号 WHERE COUNT(*)>3 AND AVG金额>200
考题
下图是使用查询设计器完成的查询,与该查询等价的SQL语句是 ______。A.select学号,数学from sc where 数学>(select avg(数学)from sC)B.select学号where数学>(select avg(数学)from sC)C.select数学avg(数学)from scD.select数学>(select avg(数学)from sC)
考题
求每个交易所的平均单价的SQL语句是A)SELECT交易所,avg(单价)FROM stock GRDER BY单价B)SELECT交易所,avg(单价)FROM stock ORDER BY单价C)SELECT交易所,avg(单价)FROM stock ORDER BY交易所D)SELECT交易所,avg(单价)FROM stock GROUP BY交易所
考题
求每个交易所的平均单价的SQL语句是______。A.SELECT 交易所,avg(单价)FROM stock GROUP BY 单价B.SELECT 交易所,avg(单价)FROM stock ORDER BY 单价C.SELECT 交易所,avg(单价)FROM stock ORDER BY 交易所D.SELECT 交易所,avg(单价)FROM stock GROUP BY 交易所
考题
下图是使用查询设计器完成的查询,与该查询等价的SQL语句是( )。A.select学号,数学from SC where数学>;(select avg(数学)from sC.B.select学号where数学>;(select avg(数学)from sC.C.select数学avg(数学)from SCD.select数学>;(select avg(数学)from SC.
考题
设ABC表的A列存储电话号码信息,则查询不是以7开头的所有电话号码的查询语句是( )
A select A from ABC where A is not ‘%7’B select A from ABC where A like ‘%7%’C select A from ABC where A not like ‘7%’D select A from ABC where A like ‘[1-6]%’
考题
下图是使用查询设计器完成的查询,与该查询等价的SQL语句是( )。A.select 学号,数学from sc where数学>(select avg(数学)fromsc)B.select 学号 where 数学>(select avg(数学)fromsc)C.select 数学 avg(数学)from scD.select 数学>(select avg(数学)from sc)
考题
假设同一名称的课程有不同的学生选修和不同的老师教授,则计算每门课程的平均分的SQL语句是( )。A)SELECT 课程名称,AVG(成绩)FROM 课程 GROUP BY 成绩B)SELECT 课程名称,AVG(成绩)FROM 课程 0RDER BY 成绩C)SELECT 课程名称,AVG(成绩)FROM 课程 0RDER BY 课程名称D)SELECT 课程名称,AVG(成绩)FROM 课程 GROUP BY 课程名称
考题
求至少有两个职工的每个仓库的平均工资A.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;HAVING COUNT(*)=2B.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;GROUP BY 仓库号 HAVING COUNT(*)=2C.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;GROUP BY 仓库号 SET COUNT(*)=2D.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;GROUP BY 仓库号 WHERE COUNT(*)=2
考题
现有书目表book,包含字段:价格price(float),类别type(char);现在查询各个类别的平均价格、类别名称,以下语句正确的是()。A、select avg(price),type from book group by typeB、select count(price),type from book group by priceC、select avg(price),type from book group by priceD、select count(price),type from book group by type
考题
Click the Exhibit button and examine the data in the EMPLOYEES table. Which three subqueries work?()A、SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department_id);B、SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);C、SELECT distinct department_id FROM employees WHERE salary ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);D、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);E、SELECT last_name FROM employees WHERE salary ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);F、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));
考题
Examine the data in the EMPLOYEES table: LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 ... Which three subqueries work? ()A、SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);B、SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);C、SELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);D、SELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);E、SELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);F、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));
考题
多选题Click the Exhibit button and examine the data in the EMPLOYEES table. Which three subqueries work?()ASELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department_id);BSELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);CSELECT distinct department_id FROM employees WHERE salary ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);DSELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);ESELECT last_name FROM employees WHERE salary ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);FSELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));
热门标签
最新试卷