Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.name

Explanation / 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 Wijaya
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote