All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g0201_0300.s0262_trips_and_users.script.sql Maven / Gradle / Ivy

There is a newer version: 1.30
Show newest version
# Write your MySQL query statement below
# #Hard #Database #2022_11_01_Time_577_ms_(63.97%)_Space_0B_(100.00%)
SELECT request_at AS "Day",
       ROUND(cast(SUM(CASE
                     WHEN t.status != 'completed' THEN 1
                     ELSE 0
                 END) as decimal(7,2))/count(*), 2) AS "Cancellation Rate"
FROM Trips t
INNER JOIN Users a ON (a.users_id = t.client_id)
AND (a.banned='No')
INNER JOIN Users b ON (b.users_id = t.driver_id)
AND (b.banned='No')
WHERE request_at BETWEEN '2013-10-01' AND '2013-10-03'
GROUP BY request_at;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy