PrepAway - Latest Free Exam Questions & Answers

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

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

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT * FROM t1
UNION
SELECT * FROM t2

B.
SELECT * FROM t1
UNION DISTINCT
SELECT * FROM t2

C.
SELECT * FROM t1
INTERSECT
SELECT * FROM t2

D.
SELECT * FROM t1
WHERE (c1,c2)=
(SELECT c1,c2 FROM t2)

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


Leave a Reply