Home » Other » Training & Certification » NULL RESOLUTION
NULL RESOLUTION [message #274852] Wed, 17 October 2007 07:13 Go to next message
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.
Re: NULL RESOLUTION [message #274859 is a reply to message #274852] Wed, 17 October 2007 07:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
NULL

Regards
Michel
Re: NULL RESOLUTION [message #274893 is a reply to message #274852] Wed, 17 October 2007 10:53 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Why will the query fail in case of answer A and not for C?
Both will return 0 rows

(ok, taken that case does not matter in C)

[Updated on: Wed, 17 October 2007 10:54]

Report message to a moderator

Re: NULL RESOLUTION [message #274926 is a reply to message #274893] Wed, 17 October 2007 13:38 Go to previous messageGo to next message
ramanathan manickam
Messages: 27
Registered: July 2007
Junior Member
Even i have the same doubt? what is the difference?
Re: NULL RESOLUTION [message #274928 is a reply to message #274926] Wed, 17 October 2007 14:01 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The difference between what and what?
Did you read the link I posted?

Regards
Michel
Previous Topic: field validation
Next Topic: when form builder open which trigger will fire first and last
Goto Forum:
  


Current Time: Thu Dec 08 20:05:25 CST 2016

Total time taken to generate the page: 0.05704 seconds