READ Free Dumps For Oracle- 1z0-001
Question ID 8150 | You need to retrieve the employee names and salaries from emp tables assorted by the salary in descending order. If two names match for a salary then two names must be displayed in alphabetical order. Which statement produces the required results?
|
Option A | SELECT ename,sal FROM emp ORDER BY ename,sal;
|
Option B | SELECT ename,sal FROM emp ORDER BY sal,ename;
|
Option C | SELECT ename,sal FROM emp SORT BY sal DESC,ename;
|
Option D | SELECT ename,salFROM emp ORDER BY sal DESC,ename;
|
Option E | SELECT ename,sal FROM emp ORDER BY sal DESC,ename ASCENDING;
|
Correct Answer | D |
Explanation Explanation/Reference: Explanation: Answer D is correct. ORDER BY clause will sort the salary in descending order because of keyword DESC and will show the employee names in alphabetical order (default option for ORDER BY clause). Incorrect Answers: A: Result will be sorted first by the employee names, not by the salary. B: Result will show the salary sorted in ascending, not in descending order. C: SORT BY is wrong clause of the SELECT statement. E: ASCENDING is wrong clause of the SELECT statement. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 18-19 Chapter 1: Selecting Data from Oracle
Question ID 8151 | Which statement about using a sub query in the from clause is true?
|
Option A | You can't use a sub query in the from clause.
|
Option B | You eliminate the need to create a new view or table by placing a sub query in the from clause.
|
Option C | You eliminate the need to grant select privileges on the table used in the from clause sub query.
|
Option D | You define a data source for future select statement when using a sub query in the from clause.
|
Correct Answer | B |
Explanation Explanation/Reference: Explanation: Answer B is correct because you don't need to create a new view or table, join them with a table or view in main query and extract result from join construction. Incorrect Answers: A: You can use a sub query in the FROM clause. C: By using a sub query you don't eliminate the need to grant select privileges on the tables used in the FROM clause sub query. D: You cannot use sub query for future needs, it exists only during the main query execution time. Oracle 8, DBA Certification Exam Guide, Jason S. Couchman, p. 64-72 Chapter 2: Advanced Data Selection in Oracle