# 有可能数据本身就不全,就需要自行创建临时表WITH T as(SELECT'Android' p1,'Reading' e1
UNIONSELECT'Android' p1,'Sports' e1
UNIONSELECT'Android' p1,'Programming' e1
UNIONSELECT'IOS' p1,'Reading' e1
UNIONSELECT'IOS' p1,'Sports' e1
UNIONSELECT'IOS' p1,'Programming' e1
UNIONSELECT'Web' p1,'Reading' e1
UNIONSELECT'Web' p1,'Sports' e1
UNIONSELECT'Web' p1,'Programming' e1
)SELECT T.p1 platform,T.e1 experiment_name,IFNULL(t1.n,0) num_experiments
FROM T
LEFTJOIN(SELECT platform,experiment_name,count(experiment_id) n
FROM Experiments
GROUPBY platform,experiment_name
)t1
ON T.p1=t1.platform AND T.e1=t1.experiment_name
1.3 运行截图
2 无流量的账户数
2.1 题目内容
2.1.1 基本题目信息1
2.1.2 基本题目信息2
2.1.3 示例输入输出
2.2 示例sql语句
# 在2021年订阅,意味着只要账户开始日期或者结束日期,符合2021年即可SELECTcount(account_id) accounts_count
FROM Subscriptions
WHERE(date_format(start_date,'%Y')='2021'OR date_format(end_date,'%Y')='2021')AND account_id NOTIN(SELECTdistinct account_id
FROM Streams
WHERE date_format(stream_date,'%Y')='2021')
2.3 运行截图
3 面试中被录取的候选人
3.1 题目内容
3.1.1 基本题目信息1
3.1.2 基本题目信息2
3.1.3 示例输入输出
a 示例输入
b 示例输出
3.2 示例sql语句
# ①先找出至少有两年工作经验的候选人,②找出面试分数之和严格大于151的候选人 ③把两者进行内连接就行SELECT t1.candidate_id
FROM(SELECT candidate_id,interview_id
FROM Candidates
WHERE years_of_exp>=2)t1
INNERJOIN(SELECT interview_id
FROM Rounds
GROUPBY interview_id
HAVINGSUM(score)>15)t2
ON t1.interview_id=t2.interview_id