niusouti.com

Evaluate these two SQL statements:SELECT last_name, salary , hire_dateFROM EMPLOYEESORDER BY salary DESC;SELECT last_name, salary, hire_dateFROM EMPLOYEESORDER BY 2 DESC;What is true about them? ()A. The two statements produce identical results.B. The sec

题目
Evaluate these two SQL statements:SELECT last_name, salary , hire_dateFROM EMPLOYEESORDER BY salary DESC;SELECT last_name, salary, hire_dateFROM EMPLOYEESORDER 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.


相似考题
更多“Evaluate these two SQL statements:SELECT last_name, salary , hire_dateFROM EMPLOYEESORDER BY salary DESC;SELECT last_name, salary, hire_dateFROM EMPLOYEESORDER BY 2 DESC;What is true about them? () ”相关问题
  • 第1题:

    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));


    参考答案:C, D, E

  • 第2题:

    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


    D

  • 第3题:

    先按课程号升序排列,再按成绩降序排列检索出选课表中的所有信息,下面SQL语句正确的是()。

    A.SELECT * FROM 选课表 GROUP BY 课程号 DESC,成绩 DESC;

    B.SELECT * FROM 选课表 GROUP BY 课程号,成绩;

    C.SELECT * FROM 选课表 ORDER BY 课程号,成绩 DESC;

    D.SELECT * FROM 选课表 ORDER BY 课程号 DESC,成绩;


    select * from sc order by cid asc,grade desc

  • 第4题:

    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


    正确答案:D

  • 第5题:

    下列的预编译SQL语句,哪一个是正确的?

    A.select * from ?

    B.select ?,?,? from emp

    C.select * from emp where eno=? salary>?

    D.select * from emp where ename=? and dept=?


    select * from emp where ename=? and dept=?