PrepAway - Latest Free Exam Questions & Answers

Which of the following queries will produce the same result set as the query above?

Given the following table definitions:
EMPLOYEE
ID NAME DEPTID
— —— ———
01 Smith 10
02 Bossy 20
03 Peterson 20
04 Goss 30
05 Pape 40
06 Avery 50
07 O’Neal 60
08 Carter 50
DEPARTMENT
ID DEPTNAME
— ————–
05 Hardware

10 Kitchen
20 Shoes
30 Toys
40 Electronics
50 Automotive
and the following query:
SELECT e.id, d.deptname
FROM employee e, department d
WHERE e.deptid = d.id AND e.id > 4
Which of the following queries will produce the same result set as the query above?

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT e.id,d.deptname
FROM employee e, department d
WHERE e.id > 4

B.
SELECT e.id,d.deptname
FROM employee e
INNER JOIN
department d
ON e.deptid = d.id
WHERE e.id > 4

C.
SELECT e.id,d.deptname
FROM employee e
FULL OUTER JOIN
department d
ON e.id = d.id
WHERE e.id > 4

D.
SELECT e.id,d.deptname
FROM employee e
LEFT OUTER JOIN
department d
ON e.deptid = d.id
WHERE e.id > 4
UNION ALL
SELECT e.id, d.deptname
FROM employee e
RIGHT OUTER JOIN
department d
ON e.deptid = d.id
WHERE e.id > 4


Leave a Reply