AnalystPath

Cancellation Rate (Unbanned Users)

SQLHardSenior levelUber~15 min

Problem

**[Asked at Uber]**

A trip is included only if **both the client and driver are not banned**.
Calculate the **cancellation rate** as a percentage rounded to 2 dp.

Tables

Example rows — the live problem includes the full dataset.

users
user_idis_banned
trips
trip_idclient_iddriver_idstatustrip_date

Expected output

Your answer should return 1 row with the columns cancellation_rate.

Starter code (SQL)

SELECT *
FROM users;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions