How many rows are returned by the SQL statement?

You have the database table named Cars as defined below:

You have the following Structured Query Language (SQL) statement:

How many rows are returned by the SQL statement?
A. 4
B. 5
C. 6
D. 7

How To Pass 98-364 Exam?

FULL Printable PDF and Software. VALID exam to help you PASS.

microsoft-exams

12 thoughts on “How many rows are returned by the SQL statement?

  1. create table t1
    (
    stype varchar(100),
    scolor varchar(100),
    sorigin varchar(100)
    )

    insert into t1 values (‘Sedan’,’Red’,’Japan’);
    insert into t1 values (‘Truck’,’Red’,’USA’);
    insert into t1 values (‘Minivan’,’Silver’,’Japan’);
    insert into t1 values (‘hback’,’Red’,’Japan’);
    insert into t1 values (‘copmact’,’Black’,’Japan’);
    insert into t1 values (‘SUV’,’Silver’,’Germany’);
    insert into t1 values (‘convertible’,’Black’,’USA’);
    insert into t1 values (‘hybrid’,’Black’,’Germany’);

    select * from t1 c where c.sorigin ‘USA’ and c.sColor ‘Black’

  2. A is correct.

    ” means not equal to. Can also be written as ‘!=’

    Therefore only four rows have values without either ‘Black’ or ‘USA’ in them.

    1
    1
      1. Not accepting the greater than/ less than signs for some reason. But you know what I mean.

  3. Correct Answer: A

    There are 3 black cars (one from USA) AND another car from USA, making it 4 cars altogether.

    1
    1
  4. Answer should be 7. Out of 8 rows, only one fits the condition ( not black and not from usa simultanously)

    1. logicly Mateusz is right. but sql logic is different. if you use AND any condition filter records. so A is correct. you can try 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.