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

For each city, list number of customers from the city, who have placed order(s).

ID: 3695380 • Letter: F

Question

For each city, list number of customers from the city, who have placed order(s). Cities are listed in ascending alphabetical order. Use equal join for this query. – (Hint: make sure your query does not to count the same customer more than once.)

CITY                 COUNT(DISTINCTCUSTOMER.CUST_ID)

-------------------- -------------------------------

SF                                                1

SLC                                             6

Tucson                                         2

Explanation / Answer

Suppose it has 2 table where table1 has has city_name and count of customer_id and table2 has count of customer_id,city_name,population so to show equal join below query can be used :

Select count(DISTINCTCUSTOMER.CUST_ID) from table1,table2 where table1.city_name=table2.city_name and table1.CUSTOMER.CUST_ID = table2.CUSTOMER.CUST_ID;

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