A. The SELECT statement is syntactically accurate.
B. The SELECT statement does not work because there is no HAVING clause.
C. The SELECT statement does not work because the column specified in the GROUP BY clause is not in the SELECT list.
D. The SELECT statement does not work because the GROUP BY clause should be in the main query and not in the subquery.
第1题:
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));
第2题:
以“成绩”表为数据源,按“课程编号”字段统计每门课程最高分的SQL语句是()。
A.SELECT 课程编号,MAX(成绩)AS 最高分 FROM 成绩
B.SELECT 课程编号,MAX(成绩)AS 最高分 FROM 成绩 ORDER BY 课程编号
C.SELECT 课程编号,成绩 FROM 成绩 WHERE 成绩>ANY
D.SELECT 课程编号,MAX(成绩)AS 最高分 FROM 成绩 GROUP BY 课程编号
第3题:
有这样一个数据表,职工(职工号,姓名,职务,工资),要想查询工资最高的职工号和姓名,以下SELECT语句正确的是()
A.SELECT职工号, 姓名FROM职工 WHERE工资= MAX(工资)
B.SELECT职工号, 姓名FROM职工 WHERE工资=(SELECT MAX(工资) FROM职工)
C.SELECT职工号, 姓名, 工资FROM职工 WHERE工资=MAX(工资)
D.SELECT职工号, 姓名,MAX(工资) FROM职工WHERE工资=MAX(工资)
第4题:
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));
第5题:
下列的预编译SQL语句,哪一个是正确的?
A.select * from ?
B.select ?,?,? from emp
C.select * from emp where eno=? salary>?
D.select * from emp where ename=? and dept=?
第6题:
有这样一个数据表,职工表(职工号,姓名,职务,工资),要想查询工资最高的职工号和姓名,以下SELECT语句正确的是
A.SELECT职工号, 姓名FROM职工 WHERE工资= MAX(工资)
B.SELECT职工号, 姓名FROM职工 WHERE工资=(SELECT MAX(工资) FROM职工)
C.SELECT职工号, 姓名, 工资FROM职工 WHERE工资=MAX(工资)
D.SELECT职工号, 姓名,MAX(工资) FROM职工WHERE工资=MAX(工资)