PrepAway - Latest Free Exam Questions & Answers

How many rows are returned?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
0

B.
1

C.
2

D.
3

E.
4

6 Comments on “How many rows are returned?

  1. Ranajoy Roy says:

    The answer should be 4,Option E.. because not null scan those columns where the value is NULL in the column but if the column value is blank not null will not consider it as a NULL value,thus it will return all values..




    1



    5
  2. avalon333 says:

    CREATE TABLE Product (ID INTEGER PRIMARY KEY, Name VARCHAR(20), Quantity INTEGER)

    INSERT INTO dbo.Product(ID, Name, Quantity) VALUES (‘1234’, ‘Apples’, ’33’), (‘2615’, ‘Oranges’, ‘0’), (‘3781’, ‘Pears’, ’29’), (‘4589’, ‘Plums’, ”);

    SELECT Name FROM Product WHERE Quantity IS NOT NULL

    Returns: 4 rows




    2



    1
    1. avalon333 says:

      So when i Try to delete value in Quantity Plums it gives an error stating: Invalid value row 4, column 3. Changed value was not recognised as valid. Datatype INT32. Inputstring was not correct format.

      So the table from example, cannot exist..? If table can exist, answer is D (3). If table does not exist, answer is E (4)




      0



      0

Leave a Reply