We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 048c108 commit dd4cb7fCopy full SHA for dd4cb7f
1 file changed
MySQL/trips-and-users.sql
@@ -0,0 +1,11 @@
1
+# Time: O((t * u) + tlogt)
2
+# Space: O(t)
3
+
4
+select
5
+t.Request_at Day,
6
+round(sum(case when t.Status like 'cancelled_%' then 1 else 0 end) / count(*), 2) Rate
7
+from Trips t
8
+inner join Users u
9
+on t.Client_Id = u.Users_Id and u.Banned='No'
10
+where t.Request_at between '2013-10-01' and '2013-10-03'
11
+group by t.Request_at
0 commit comments