exam questions

Exam 98-364 All Questions

View all questions & answers for the 98-364 exam

Exam 98-364 topic 1 question 26 discussion

Actual exam question from Microsoft's 98-364
Question #: 26
Topic #: 1
[All 98-364 Questions]

You have the following table definition:

CREATE TABLE Product -
(ID INTEGER PRIMARY KEY,
Name VARCHAR(20),
Quantity INTEGER)
The Product table contains the following data.

You execute the following statement:
SELECT Name FROM Product WHERE Quantity IS NOT NULL
How many rows are returned?

  • A. 0
  • B. 1
  • C. 2
  • D. 3
  • E. 4
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Hunt5ta
Highly Voted 5 years, 6 months ago
This would be the right answer because in SQL Server if a cell were to be empty it would default be null. Proof: I did it in SQL server
upvoted 11 times
...
alperezs
Most Recent 3 years ago
Trick question. I can't insert row 4 with an empty value in an entire column. The answer is D.
upvoted 1 times
...
Morgane
3 years, 8 months ago
No expert here but the answer makes sense to me if NOT NULL means that a column value is required and NULL means column value is optional. Even 0 is a value.
upvoted 1 times
...
samuraipizza26
3 years, 12 months ago
I don't know about your experience but for me it is impossible to have an "empty" INT field. It is NULL and just showing empty in this image. C is the answer.
upvoted 1 times
...
Nate_DB
4 years, 3 months ago
The answer is wrong. Run this for the proof: CREATE TABLE #Temp (A INT, B VARCHAR(5)) -- INSERT INTO #Temp (A,B) select 1, 'abc' union select 2, '' union select 3, null union select 4, 'dd' select * from #Temp select * from #Temp where b is not null select * from #Temp where b <> '' select * from #Temp where ISNULL(b,'') <> ''
upvoted 1 times
...
YulyV
4 years, 3 months ago
The answer is E
upvoted 1 times
...
AntidotE
4 years, 6 months ago
Since Quantity is Integer, not having a value means it is NULL. For string empty value might mean empty value and not NULL.
upvoted 3 times
...
Pink_Dreams
4 years, 9 months ago
Great Clarification from all of you. Thanks for sharing!
upvoted 1 times
...
Buzzrite
4 years, 9 months ago
Nice, i did not know that. Good Stuff, thanks
upvoted 1 times
...
krieffer
5 years, 1 month ago
The test is for SQL Server. In there, empty cells are treated like NULL.
upvoted 2 times
...
JoshW
5 years, 3 months ago
Empty Cell values default to NULL SQL Server -answer is D -3
upvoted 4 times
...
leonardo
5 years, 7 months ago
Wrong answer, becuase Quantity is empty not null
upvoted 4 times
Naga01
4 years, 8 months ago
when a cell is empty sql server consider it as Null so the answer is 3
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...