What Cities View and Buy

What Cities View and Buy

L. is checking how product interest turned into purchases across different cities. For each city, separately count product_view and purchase events, using a condition-based counter for each metric.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.

cityviewspurchases
Khvostov01
Kotovsk10
Miausino01
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid