OCP-1Z0-051-V9.02-17题
2013-09-02 14:54
417 查看
17. View the E xhibit and examine the data in the EMPLOYEES table.
You want to generate a report showing the total compensation paid to each employee to date.
You issue the following query:
SQL>SELECT ename ' joined on ' hiredate
', the total compensation paid is '
TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365) * sal + comm)
"COMPENSATION UNTIL DATE"
FROM employees;
What is the outcome?
A. It generates an error because the alias is not valid.
B. It executes successfully and gives the correct output.
C. It executes successfully but does not give the correct output.
D. It generates an error because the usage of the ROUND function in the expression is not valid.
E. It generates an error because the concatenation operator can be used to combine only two items.
因为comm有null值,故任何数值与nll相加为null,故出错。
此题答案选C
You want to generate a report showing the total compensation paid to each employee to date.
You issue the following query:
SQL>SELECT ename ' joined on ' hiredate
', the total compensation paid is '
TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365) * sal + comm)
"COMPENSATION UNTIL DATE"
FROM employees;
sys@TESTDB> select * from scott.emp; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- ---------- --------- ---------- --------- ---------- ---------- ---------- 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
What is the outcome?
A. It generates an error because the alias is not valid.
B. It executes successfully and gives the correct output.
C. It executes successfully but does not give the correct output.
D. It generates an error because the usage of the ROUND function in the expression is not valid.
E. It generates an error because the concatenation operator can be used to combine only two items.
sys@TESTDB> select TO_CHAR(ROUND(ROUND(SYSDATE-hiredate)/365) * sal + comm) "COMPENSATION UNTIL DATE" 2 from scott.emp; COMPENSATION UNTIL DATE ---------------------------------------- 53100 41750 41400 48000 14 rows selected.
因为comm有null值,故任何数值与nll相加为null,故出错。
此题答案选C
相关文章推荐
- OCP-1Z0-051-V9.02-17题
- OCP-1Z0-051-V9.02-121题
- OCP-1Z0-051-V9.02-15题
- OCP-1Z0-051-V9.02-94题
- OCP-1Z0-051-V9.02-144题
- OCP-1Z0-051-V9.02-112题
- OCP-1Z0-051-V9.02-153题
- OCP-1Z0-051-V9.02-48题
- OCP-1Z0-051-V9.02-56题
- OCP-1Z0-051-V9.02-74题
- OCP-1Z0-051-V9.02-84题
- OCP-1Z0-051-V9.02-117题
- OCP-1Z0-051-V9.02-134题
- OCP-1Z0-051-V9.02-162题
- OCP-1Z0-051-V9.02-4题
- OCP-1Z0-051-V9.02-23题
- OCP-1Z0-051-V9.02-127题
- OCP-1Z0-051-V9.02-16题
- OCP-1Z0-051-V9.02-118题
- OCP-1Z0-051-V9.02-95题