SELECT q.query_name,ROUND(AVG(q.rating/q.position),2) quality,ROUND(100*(SELECTcount(*)FROM Queries WHERE rating<3AND query_name=q.query_name)/count(*),2) poor_query_percentage
FROM Queries q
GROUPBY q.query_name
1.3 运行截图
2 每月交易Ⅰ
2.1 题目内容
2.1.1 基本题目信息
2.1.2 示例输入输出
2.2 示例sql语句
WITH T as(SELECT id,country,state,amount,DATE_FORMAT(trans_date,'%Y-%m')monthFROMTransactions)SELECTmonth,country,count(*) trans_count,count(IF(state='approved',1,null)) approved_count,SUM(amount) trans_total_amount,SUM(IF(state='approved',amount,0)) approved_total_amount
FROM T
GROUPBYmonth,country
2.3 运行截图
3 即时食物配送Ⅱ
3.1 题目内容
3.1.1 基本题目信息
3.1.2 示例输入输出
3.2 示例sql语句
WITH T as(SELECT t2.*FROM(SELECT*,rank()over(partitionby customer_id ORDERBY order_date asc) rk
FROM Delivery
)t2
WHERE t2.rk=1)SELECTROUND(100*count(IF(order_date=customer_pref_delivery_date,1,null))/count(*),2) immediate_percentage
FROM T
二阶张量在特定方向的投影
法向和切向分量
二阶张量T投影到 n ^ \hat n n^方向的结果是 t ⃗ ( n ^ ) T ⋅ n ^ \vec t^{(\hat n)}T \cdot \hat n t (n^)T⋅n^,其中 t ⃗ ( n ^ ) \vec t^{(\hat n)} t (n^)可以分解成: t ⃗ ( n ^ ) T ⃗ N T ⃗ S…