
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
The
Trips
table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at theUsers
table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’).The
Users
table holds all users. Each user has an unique Users_Id, and Role is an ENUM type of (‘client’, ‘driver’, ‘partner’).Write a SQL query to find the cancellation rate of requests made by unbanned clients between Oct 1, 2013 and Oct 3, 2013. For the above tables, your SQL query should return the following rows with the cancellation rate being rounded to two decimal places.
这道题给了我们一个Trips表里面有一些Id和状态,还有请求时间,然后还有一个Users表,里面有顾客和司机的信息,然后有该顾客和司机有没有被Ban的信息,让我们返回一个结果看某个时间段内由没有被ban的顾客提出的取消率是多少,其实题目没有说清楚顾客到底包不包括司机,其实是包括的,由司机提出的取消请求也应计算进去,我们用Case When ... Then ... Else ... End关键字来做,我们用cancelled%来表示开头是cancelled的所有项,这样就包括了driver和client,然后分母是所有项,限制条件里限定了时间段,然后是没有被ban的,由于结果需要保留两位小数,所以我们用Round关键字且给定参数2即可,参见代码如下:
解法一:
上面的Case When ... Then ... Else ... End关键字也可以用If关键字来替换,实现的效果一样:
解法二:
参考资料:
https://leetcode.com/discuss/52594/sharing-my-solution
https://leetcode.com/discuss/96599/solution-without-join
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: