Interview Query

Time Difference

Start Timer

0:00:00

Upvote
19
Downvote
Save question
Mark as completed
View comments (19)
Next question

You work at a ride-sharing company and are given a table containing information about the rides of users.

Write a query to get the duration (in minutes) of each ride longer than two hours. Sort the results by duration in descending order.

rides table:

Columns Type
id INTEGER
passenger_user_id INTEGER
start_dt DATETIME
end_dt DATETIME
distance FLOAT
ride_region VARCHAR
is_completed INTEGER

Output:

Column Type
duration_minutes INTEGER
.
.
.
.
.


Comments

Loading comments