1Z0-007 · Question #153
The EMP table contains these columns: 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…
The correct answer is C. The operator in the WHERE clause should be changed to display the desired results. 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…
Question
The EMP table contains these columns:
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 DEPARTMENT_ID = NULL; What is true about this SQL statement?
Options
- AThe SQL statement displays the desired results.
- BThe column in the WHERE clause should be changed to display the desired results.
- CThe operator in the WHERE clause should be changed to display the desired results.
- DThe WHERE clause should be changed to use an outer join to display the desired results.
How the community answered
(47 responses)- A13% (6)
- B4% (2)
- C79% (37)
- D4% (2)
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.
Topics
Community Discussion
No community discussion yet for this question.