PrepAway - Latest Free Exam Questions & Answers

Which of the following queries will return only those rows that exist in T1 and not in T2 ?

Given that tables T1 and T2 contain the following rows:
Table T1:
C1 C2
— —
5 4
5 2
5 5
Table T2:
C1 C2
— —
5 1
5 2
5 3
Which of the following queries will return only those rows that exist in T1 and not in T2 ?

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT * FROM T1
MINUS
SELECT * FROM T2

B.
SELECT * FROM T1
EXCEPT
SELECT * FROM T2

C.
SELECT * FROM T2
UNION EXCEPT
SELECT * FROM T1

D.
SELECT * FROM T1
NOT EXISTS
SELECT * FROM T2

One Comment on “Which of the following queries will return only those rows that exist in T1 and not in T2 ?

  1. swamy says:

    The SQL EXCEPT clause/operator is used to combine two SELECT statements and returns rows from the first SELECT statement that are not returned by the second SELECT statement. This means EXCEPT returns only rows, which are not available in second SELECT statement.




    0



    0

Leave a Reply