Examine the data in the CUSTOMERS table:
You want to list all cities that have more than one customer along with the customer details.
Evaluate the following query:
SQL>SELECT c1.custname, c1.city
FROM Customers c1 __________________ Customers c2
ON (c1.city=c2.city AND c1.custname<>c2.custname);
Which two JOIN options can be used in the blank in the above query to give the correct output? (Choose two.)
A. JOIN
B. NATURAL JOIN
C. LEFT OUTER JOIN
D. FULL OUTER JOIN
E. RIGHT OUTER JOIN
A and E is correct.
correct answer a and e
a result
green seattle
king seattle
e result
king seattle
green seattle
null null
null null
A and C
Hmm…E is definitely wrong.
Wouldn’t B (Natural Join) also give right answer?
Will join same as a simple/inner join aka “join”
This answer is wrong.
Answer “E” will show :
KING SEATTLE
KOCHAR SEATTLE
NULL NULL
NULL NULL
Only answer “A” returns
KING SEATTLE
KOCHAR SEATTLE