# Write your MySQL query statement belowSELECT order_date,ROUND(100*count(IF(order_date=customer_pref_delivery_date,customer_id,null))/count(*),2) immediate_percentage
FROM Delivery
GROUPBY order_date
ORDERBY order_date asc
1.3 运行截图
2 查找活跃用户
2.1 题目内容
2.1.1 基本题目信息
2.1.2 示例输入输出
2.2 示例sql语句
# Write your MySQL query statement belowSELECTdistinct u1.user_id
FROM Users u1
INNERJOIN Users u2
ON u1.user_id=u2.user_id AND DATEDIFF(u1.created_at,u2.created_at)BETWEEN0AND7AND u1.item <>u2.item AND u1.amount<>u2.amount
2.3 运行截图
3 确认率
3.1 题目内容
3.1.1 基本题目信息1
3.1.2 基本题目信息2
3.1.3 示例输入输出
a 示例输入
b 示例输出
3.2 示例sql语句
#使用SUM函数统计确认消息的数量#注意: 没有请求任何确认消息的用户的确认率为 0SELECT s.user_id,ROUND(IFNULL(t.r,0),2) confirmation_rate
FROM Signups s
LEFTJOIN(SELECT user_id,SUM(IF(action='confirmed',1,0))/count(*) r
FROM Confirmations
GROUPBY user_id
)t
ON s.user_id=t.user_id