Skip to content

Latest commit

 

History

History
16 lines (16 loc) · 519 Bytes

262. Trips and Users.md

File metadata and controls

16 lines (16 loc) · 519 Bytes

262. Trips and Users

Question Link

Solution

# Write your MySQL query statement below
select
request_at Day, round(sum(if(status like "cancelled%",1,0))/count(*), 2)
"Cancellation Rate" from Trips where client_id not in (
  select users_id from Users where role='client' and banned='Yes'
)
and
driver_id not in (
  select users_id from Users where role='driver' and banned='Yes'
)
and request_at between '2013-10-01' and '2013-10-03' group by request_at