题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
WITH t1 AS(SELECT 'Android' platform UNION ALL SELECT 'IOS' UNION ALL SELECT 'Web'), t2 AS(SELECT 'Reading' experiment_name UNION ALL SELECT 'Sports' UNION ALL SELECT 'Programming'), t3 AS(SELECT platform, experiment_name, COUNT(*) num_experiments FROM Experiments GROUP BY 1, 2) SELECT t1.platform, t2.experiment_name, IFNULL(num_experiments, 0) num_experiments FROM t1 JOIN t2 LEFT JOIN t3 USING(platform, experiment_name)