"content":"<p>Table: <code>Trips</code></p>\n\n<pre>\n+-------------+----------+\n| Column Name | Type |\n+-------------+----------+\n| id | int |\n| client_id | int |\n| driver_id | int |\n| city_id | int |\n| status | enum |\n| request_at | date | \n+-------------+----------+\nid is the primary key (column with unique values) for this table.\nThe table holds all taxi trips. Each trip has a unique id, while client_id and driver_id are foreign keys to the users_id at the Users table.\nStatus is an ENUM (category) type of ('completed', 'cancelled_by_driver', 'cancelled_by_client').\n</pre>\n\n<p> </p>\n\n<p>Table: <code>Users</code></p>\n\n<pre>\n+-------------+----------+\n| Column Name | Type |\n+-------------+----------+\n| users_id | int |\n| banned | enum |\n| role | enum |\n+-------------+----------+\nusers_id is the primary key (column with unique values) for this table.\nThe table holds all users. Each user has a unique users_id, and role is an ENUM type of ('client', 'driver', 'partner').\nbanned is an ENUM (category) type of ('Yes', 'No').\n</pre>\n\n<p> </p>\n\n<p>The <strong>cancellation rate</strong> is computed by dividing the number of canceled (by client or driver) requests with unbanned users by the total number of requests with unbanned users on that day.</p>\n\n<p>Write a solution to find the <strong>cancellation rate</strong> of requests with unbanned users (<strong>both client and driver must not be banned</strong>) each day between <code>"2013-10-01"</code> and <code>"2013-10-03"</code>. Round <code>Cancellation Rate</code> to <strong>two decimal</strong> points.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example1:</strong></p>\n\n<pre>\n<strong>Input:</strong>\nTripstable:\n+----+-----------+-----------+---------+---------------------+------------+\n|id|client_id|driver_id|city_id|status|request_at|\n+----+-----------+-----------+---------+---------------------+------------+\n|1|1|10|1|completed|2013-10-01|\n|2|2|11|1|cancelled_by_driver|2013-10-01|\n|3|3|12|6|completed|2013-10-01|\n|4|4|13|6|cancelled_by_client|2013-10-01|\n|5|1|10|1|completed|2013-10-02|\n|6|2|11|6|completed|2013-10-02|\n|7|3|12|6|completed|2013-10-02|\n|8|2|12|12|completed|2013-10-03|\n|9|3|10|12|completed|2013-10-03|\n|10|4|13|12|cancelled_by_driver|2013-10-03|\n+----+-----------+-----------+---------+---------------------+------------+\nUserstable:\n+----------+--------+--------+\n|users_id|banned|role|\n+----------+--------+--------+\n|1|No|client|\n|2|Yes|client|\n|3|No|client|\n|4|No|client|\n|10|No|driver|\n|11|No|driver|\n|12|No|driver|\n|13|No|driver|\n+----------+--------+--------+\n<strong>Output:</strong>\n+------------+-------------------+\n|Day|CancellationRate|\n+------------+-------------------+\n|2013-10-01|0.33|\n|2013-10-02|0.00|\n|2013-10-03|0.50|\n+------------+-------------------+\n<strong>Explanation:</strong>\nOn2013-10-01:\n-Therewere4requestsintotal,2ofwhichwerecanceled.\n-However,therequestwithId=2wasmadebyabannedclient(User_Id=2),soitisignoredinthecalculation.\n-Hencethereare3unbannedrequestsintotal,1of
"Create table If Not Exists Trips (id int, client_id int, driver_id int, city_id int, status ENUM('completed', 'cancelled_by_driver', 'cancelled_by_client'), request_at varchar(50))",
"Create table If Not Exists Users (users_id int, banned varchar(50), role ENUM('client', 'driver', 'partner'))",