READ Free Dumps For Oracle- 1z0-007
Question ID 7889 | What is necessary for your query on an existing view to execute successfully?
|
Option A | The underlying tables must have data.
|
Option B | You need SELECT privileges on the view
|
Option C | The underlying tables must be in the same schema.
|
Option D | You need SELECT privileges only on the underlying tables.
|
Correct Answer | B |
Explanation Explanation/Reference: Explanation: To query an existing view you need to have SELECT privileges on the view. Incorrect Answers A: The underlying tables can be without data: view will work correctly in that case. C: The underlying tables can be in different user schema. D: You need SELECT privileges not only on the underlying tables, but on the view also. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 356-359 Chapter 8: User Access Control in Oracle
Question ID 7890 | The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results?
|
Option A | SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;
|
Option B | SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;
|
Option C | SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;
|
Option D | SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5;
|
Correct Answer | C |
Explanation Explanation/Reference: Explanation: Expression SYSDATE-HIRE_DATE will show number of days after date of hiring employee, so you need to divide result of expression on 365 and this compare result with 5. Incorrect Answers A: This query returns all employees who were hired more than 5 days ago. B: This query will not return any record because result of HIRE_DATE-SYSDATE expression will be negative number. D: You need to divide, not to multiply, SYSDATE-HIRE_DATE on the number of days in 1 year. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 81-85 Chapter 2: Limiting, Sorting, and Manipulating Return Data