NULL RESOLUTION [message #274852] |
Wed, 17 October 2007 07:13 |
ramanathan manickam
Messages: 27 Registered: July 2007
|
Junior Member |
|
|
Am preparing for sql certification, clarify me on the below question. how do we justify the answer? what does the null resolution means..
1.The employee table contains these columns:
FIRST-NAME VARCHER2(25)
COMISSION NUMBER(3,2)
Evaluate this SQL statement
SELECT first-name,commission
FROM employee
WHERE commission=
(SELECTcomission
FROM employee
WHERE UPPER(first-name)= ‘scott’)
Which statement will cause this statement to fail?
A. Scott has a null commission resolution.
B. Scott has a zero commission resolution.
C. There is no employee with the first name Scott.
D. The first name values in the data base are in the lower case.
Answer: A
Explanation:
Answer A is correct because if Scott has a null commission expression in WHERE clause
will cause error.
Incorrect Answers:
B:
Query will work correctly.
C:
Query will work even without employee with the first name Scott.
D:
Name values will be converted to upper case by function UPPER, query will work,
but for correct result you need to change UPPER to LOWER function.
|
|
|
|
|
|
|