# Write your MySQL query statement belowSELECT s.user_id,sum(s.quantity*p.price) spending
FROM Sales s
INNERJOIN Product p
ON s.product_id=p.product_id
GROUPBY s.user_id
ORDERBY spending desc,s.user_id asc
1.3 运行截图
2 联赛的所有比赛
2.1 基本题目内容
2.1.1 基本题目信息
2.1.2 示例输入输出
2.2 示例sql语句
# Write your MySQL query statement belowSELECT t1.team_name home_team,t2.team_name away_team
FROM Teams t1
CROSSJOIN Teams t2
ON t1.team_name <> t2.team_name
2.3 运行截图
3 每位教师所教授的科目种类的数量
3.1 题目内容
3.1.1 基本题目信息
3.1.2 示例输入输出
3.2 示例sql语句
# Write your MySQL query statement belowSELECT teacher_id,count(distinct subject_id) cnt
FROM Teacher
GROUPBY teacher_id