Evaluate these two SQL statements: SELECT last_name, salary, hire_dateFROM EMPLOYEES ORDRE BY salary DESC; SELECT last_name, salary, hire_dateFROM EMPOLYEES ORDER BY 2 DESC; What is true about them? ()
A. The two statements produce identical results.
B. The second statement returns a syntax error.
C. There is no need to specify DESC because the results are sorted in descending order by default.
D. The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.
第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 AVG(SALARY));
第2题:
SQL中,SALARYIN(1000,2000)的语义是______。
A.SALARY≤2000 AND SALARY≥1000
B.SALARY<2000 AND SALARY>1000
C.SALARY=1000 AND SALARY=2000
D.SALARY=1000 OR SALARY=2000
第3题:
SQL中,“SALARY IN(1000,2000)”的语义是()。
A.SALARY<=2000 AND SALARY>=1000
B.SALARY<2000 AND SALARY>1000
C.SALARY=1000 AND SALARY=2000
D.SALARY=1000 OR SALARY=2000
第4题:
在SQL Server 2000中,现要在employees表的first_name和last_name列上建立一个唯一的非聚集复合索引,其中first_name列数据的重复率是5%,last_name列数据的重复率是10%。请补全下列语句使以first_name和last_name列作为条件的查询效率最高。
CREATE UNIQUE NONCLUSTERED INDEX Idx_Name
ON employees(______)
第5题:
第6题:
下列的预编译SQL语句,哪一个是正确的?
A.select * from ?
B.select ?,?,? from emp
C.select * from emp where eno=? salary>?
D.select * from emp where ename=? and dept=?