Simple SQL Queries - Refer to the question below Question 16. (6 marks) (SQL) Co
ID: 3755921 • Letter: S
Question
Simple SQL Queries - Refer to the question below
Question 16. (6 marks) (SQL) Consider the following instances of the tables customer and order customer cid cnane countr Agus Suparman Indonesia Dewi Rendra Made W Tan Wee Sion Siti Bte Mohamad Singapore Indonesia Indonesia Singapore order pid cid ty 100 5 10 5 50 Find the result of the following two queries: SELECT c.cname FROM customer c LEFT OUTER JOIN order o ON c.cid-o.cid WHERE c.country ='Indonesia. AND o cid IS NULL; results c.name SELECT c.cname FROM customer c LEFT OUTER JOIN order o ON c.cid=o.cid AND c.country-indonesia. WHERE o.cid IS NULL; results c.nameExplanation / Answer
1) Select c.cname from customer c LEFT OUTER JOIN order o ON c.cid=o.cid WHERE c.country='Indonesia' and o.cid IS NULL;
2) Select c.cname from customer c LEFT OUTER JOIN order o ON c.cid=o.cid AND c.country='Indonesia' WHERE o.cid IS NULL;
In this question LEFT OUTER JOIN behaves like LEFT JOIN.
In first part,countery filter is applied in the quey but in the second part country filter is not applied
cname Dewi Rendra Made WijayaRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.