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

题目

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.


相似考题
参考答案和解析
参考答案:A
更多“Evaluate these two SQL statements: SELECT last_name, salary, hire_dateFROM EMPLOYEES ORDRE ”相关问题
  • 第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中,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

  • 第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


    D

  • 第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(______)


    正确答案:first_nameASClast_nameDESC
    first_nameASC,last_nameDESC

  • 第5题:

    下列选项中列出的所有关键字全部属于标准SQL语言的是()。

    A.SELECT、IN、WHERE、COUNTE;
    B.SELECT、FROM、WHERE、ORDRE;
    C.SELECT、FORM、WHERE、GROUPBY;
    D.SELECT、FROM、LIKE、IN

    答案:D
    解析:
    SELECT、FROM、WHERE、GROUPBY、IN、LIKE都是属于标准SQL语言。但ORDER、COUNTE、FORM不是标准SQL语言。

  • 第6题:

    下列的预编译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=?