Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
- 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started