Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES 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_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES 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题:

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.


参考答案:A

第2题:

Evaluate these two SQL statements: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

第3题:

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

第4题:

下面哪条语句可以取出薪水最高的前三个人:()

  • A、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY );
  • B、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY ) WHERE ROWNUM<=3;
  • C、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY DESC) WHERE ROWNUM<=3;
  • D、SELECT * FROM EMPLOYEES WHERE ROWNUM<=3 ORDER BY SALARY DESC;

正确答案:C

第5题:

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

第6题:

The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(5,2)You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column.Which SQL statement displays the desired results? ()

A. SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;

B. SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;

C. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;

D. SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;


参考答案:D

第7题:

Examine the data in the EMPLOYEES table:LAST_NAME DEPARTMENT_ID SALARYGetz 10 3000Davis 20 1500Bill 20 2200Davis 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));


参考答案:C, D, E

第8题:

The EMPLOYEES table contains these columns:LAST_NAME VARCHAR2 (25)SALARY NUMBER (6,2)COMMISSION_PCT NUMBER (6)You need to write a query that will produce these results:1. Display the salary multiplied by the commission_pct.2. Exclude employees with a zero commission_pct.3. Display a zero for employees with a null commission value. Evaluate the SQL statement:SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEESWHERE COMMISSION_PCT IS NOT NULL;What does the statement provide? ()

A. All of the desired results

B. Two of the desired results

C. One of the desired results

D. An error statement


参考答案:C

第9题:

The EMPLOYEES table contains these columns: LAST_NAME VARCHAR2 (25) SALARY NUMBER (6,2) COMMISSION_PCT NUMBER (6) You need to write a query that will produce these results: 1.Display the salary multiplied by the commission_pct. 2.Exclude employees with a zero commission_pct. 3.Display a zero for employees with a null commission value. Evaluate the SQL statement: SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; What does the statement provide?()

  • A、all of the desired results
  • B、two of the desired results
  • C、one of the desired results
  • D、an error statement

正确答案:C

第10题:

The EMPLOYEE tables has these columns: LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) COMMISSION_PCT NUMBER(5,2) You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column. Which SQL statement displays the desired results?()

  • A、SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;
  • B、SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;
  • C、SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;
  • D、SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;

正确答案:D

更多相关问题