LogiQuest

548. Orders by City

EasyJOINGROUP BY

Return each customer city and the number of orders placed by customers from it as orders, ordered by city.

customers

idnamecity
1AnilDelhi
2BinaChennai
3ChetanDelhi
4DivyaKolkata
5EshaChennai

orders

idcustomer_idamountorder_date
115002024-01-05
217002024-02-10
322002024-01-20
4315002024-03-01
528002024-03-15
613002024-03-20
7510002024-02-01

Your query runs on a fresh copy of these tables (SQLite). Column names in your result do not need to match.

Loading the MyLoginn IDE…