Professional Documents
Culture Documents
Aggregated_storeData
Aggregated_storeData
WITH
city_purchase AS(
SELECT
DISTINCT City,
COUNT(DISTINCT Product_ID) AS n_Items_purchased,
ROUND(SUM(Sales),2) AS revenue_generated
FROM
`customeranalytics-382708.customer_analyticsDS.customer_data `
GROUP BY
City )
SELECT
*
FROM
city_purchase
ORDER BY
revenue_generated DESC;