A ride hailing company has their DB structured in 3 major tables as described in SCHEMA below. Write a query to fetch the city names along with earnings from each city. Earnings are calculated as the sum of fares of all the rides taken in that city. The output should be structured as: cities. name earnings The output is sorted ascending by earnings then ascending by the city name. There are 3 tables: CITIES, USERS, and RIDES. Use the language MySQL.



Answer :

Other Questions