READ Free Dumps For Oracle- 1z0-007
Question ID 7862 | The EMP table contains these columns: LAST NAME VARCHAR2(25) SALARY NUMBER(6,2) DEPARTMENT_ID NUMBER(6) You need to display the employees who have not been assigned to any department. You write the SELECT statement: SELECT LAST_NAME, SALARY, DEPARTMENT_ID FROM EMP WHERE DEPARMENT_ID = NULL; What is true about this SQL statement?
|
Option A | The SQL statement displays the desired results.
|
Option B | The column in the WHERE clause should be changed to display the desired results.
|
Option C | The operator in the WHERE clause should be changed to display the desired results.
|
Option D | The WHERE clause should be changed to use an outer join to display the desired results.
|
Correct Answer | C |
Explanation Explanation/Reference: Explanation: The operator in the WHERE clause should be changed to display the desired results. There are times when you want to substitute a value in place of NULL. Oracle provides this functionality with a special function, called NVL(). You cannot use operation equal with NULL, but you can achieve desired results using NVL() function after the WHERE clause. Incorrect Answers A: The SQL statement will generate an error because you cannot use operation equal with NULL. B: The column in the WHERE clause should not be changed to display the desired results. D: Since there is only one table used in this query you don't need to use outer join to display the desired results. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 31-32 Chapter 1: Overview of Oracle Databases
Question ID 7863 | Evaluate the SQL statement: SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual; What will be displayed?
|
Option A | 0
|
Option B | 1
|
Option C | 0.00
|
Option D | An error statement
|
Correct Answer | A |
Explanation Explanation/Reference: Explanation: Result will be 0. MOD(x,y) function calculates the modulus of x, defined in long division as the integer remainder when x is divided by y until no further whole number can be produced. TRUNC() function truncates x to the decimal precision of y. ROUND(x,y) rounds x to the decimal precision of y. Incorrect Answers B: Result will be 0, not 1. C: Result will be 0, not 0.00 because MOD(1600,10) return 0 and all other functions (TRUNC and ROUND) return 0 also. D: There is no error in this statement. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 69-71 Chapter 2: Limiting, Sorting, and Manipulating Return Data