``` Orders 表: +------------+--------------+-------------+--------------+-------------+ | order_id | customer_id | order_date | item_id | quantity | +-----------...
请按照面积大小降序排列,如果面积相同的话, 则按照 p1 和 p2 升序对结果表排序
``` Accounts 表: +----+----------+ | id | name | +----+----------+ | 1 | Winston | | 7 | Jonathan | +----+----------+
``` Sales 表: +------------+------------+-------------+ | sale_date | fruit | sold_num | +------------+------------+-------------+ | 2020-05-01 | apples | 10 | |...
题目介绍: 查找成绩处于中游的学生 find-the-quiet-students-in-all-exams
``` Users 表单: +------+-----------+ | id | name | +------+-----------+ | 1 | Alice | | 2 | Bob | | 3 | Alex | | 4 | Donald | | 7 | Lee | | 13 | Jonathan | | 19 |...
题目介绍: 购买了产品A和产品B却没有购买产品C的顾客 customers-who-bought-products-a-and-b-but-not-c
题目介绍: 顾客的可信联系人数量 number-of-trusted-contacts-of-a-customer
广告效果用点击通过率(Click-Through Rate:CTR)来衡量,公式如下:
写一条 SQL 查询计算以 7 天(某日期 + 该日期前的 6 天)为一个时间段的顾客消费平均值