We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 756f3fd commit d8eaf9cCopy full SHA for d8eaf9c
leetcode/database/README.md
@@ -0,0 +1,6 @@
1
+### LeetCode Database
2
+
3
4
+| # | Title | Solution | Difficulty |
5
+|---| ----- | -------- | ---------- |
6
+|1|[Trips and Users](https://leetcode.com/problems/trips-and-users/)| [MySQL](./TripsAndUsers.sql)|Hard|
leetcode/database/TripsAndUsers.sql
@@ -0,0 +1,9 @@
+SELECT t.`Request_at` AS Day,
+ROUND(COUNT(CASE WHEN t.`Status` = 'cancelled_by_driver' OR t.`Status` = 'cancelled_by_client' THEN 1 END) / COUNT(*), 2) AS "Cancellation Rate"
+FROM Trips t
+INNER JOIN Users u
+ON t.Client_Id = u.Users_Id
+WHERE u.Banned = 'No'
7
+AND t.Request_at >= '2013-10-01'
8
+AND t.Request_at <= '2013-10-03'
9
+GROUP BY t.Request_at
0 commit comments