Interview Query

Distance Traveled

18
Have you seen this question before?

Given the tables users and rides, write a query to report the distance traveled by each user in descending order.

Example:

Input:

users table

Column Type
id INTEGER
name INTEGER

rides table

Column Type
id INTEGER
passenger_user_id INTEGER
distance FLOAT

Output:

Column Type
name VARCHAR
distance_traveled FLOAT
Next question: Most Valuable Artwork
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query