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.37
Show newest version
# Write your MySQL query statement below
# #Hard #Database
SELECT request_at AS "Day",
       ROUND(SUM(CASE
                     WHEN t.status!= 'completed' THEN 1
                     ELSE 0
                 END)/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