RienSQL
TASK #112 · Medium · DomClick

Average spending in Hamburg

Your brief
Calculate the average spending for each type of event in the city of Hamburg. If some types of events did not occur in this city, then you need to display 0 as the average expenses.
Expected columnsevent_type average_costsDomClick
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
Countriesid, name
Regionsid, name, countryid
Citiesid, name, regionid, population
EventTypeid, name
Eventsid, cityid, typeid, date, costs