题目描述:

Write an SQL query to report the number of experiments done on each of the three platforms for each of the three given experiments. Notice that all the pairs of (platform, experiment) should be included in the output including the pairs with zero experiments.
Return the result table in any order.
The query result format is in the following example.
Example 1:

方法1:
主要思路:解题链接汇总

select 'Android' as platform, 'Reading' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Android' and experiment_name ='Reading'
union all select 'Android' as platform, 'Sports' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Android' and experiment_name ='Sports'
union all select 'Android' as platform, 'Programming' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Android' and experiment_name ='Programming'
union all select 'IOS' as platform, 'Reading' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'IOS' and experiment_name ='Reading'
union all select 'IOS' as platform, 'Sports' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'IOS' and experiment_name ='Sports'
union all select 'IOS' as platform, 'Programming' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'IOS' and experiment_name ='Programming'
union all select 'Web' as platform, 'Reading' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Web' and experiment_name ='Reading'
union all select 'Web' as platform, 'Sports' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Web' and experiment_name ='Sports'
union all select 'Web' as platform, 'Programming' as experiment_name,ifnull(count(*),0) as num_experiments
from Experiments
where platform = 'Web' and experiment_name ='Programming'

1990 Count the Number of Experiments相关推荐

  1. 1. 青蛙跳跳FrogJmp Count minimal number of jumps from position X to Y.

    青蛙跳跳: package com.code;public class Test03_1 {public int solution(int X, int Y, int D) {int res = (Y ...

  2. 【数据库系统】数据库系统学习与实践系列文章汇总目录(持续更新中)

    本文属于「数据库系统」系列文章的汇总目录,这一系列着重于「数据库系统知识的学习与实践」.由于文章内容随时可能发生更新变动,欢迎关注和收藏本文以作备忘.需要特别说明的是,为了透彻理解和全面掌握数据库系统 ...

  3. LeetCode 204. Count Primes--从一开始的质数个数--Python解法--面试算法题

    题目地址:Count Primes - LeetCode Count the number of prime numbers less than a non-negative number, n. E ...

  4. LeetCode 673. Number of Longest Increasing Subsequence--O(N log N )--Java,C++,Python解法

    题目地址:Number of Longest Increasing Subsequence - LeetCode 做这道题目前建议先做:Longest Increasing Subsequence - ...

  5. LeetCode 200. Number of Islands--c++ dfs解法

    LeetCode 200. Number of Islands LeetCode题解专栏:LeetCode题解 LeetCode 所有题目总结:LeetCode 所有题目总结 大部分题目C++,Pyt ...

  6. [LeetCode] Count Primes

    Description: Count the number of prime numbers less than a non-negative number, n 解题思路 采用Eratosthene ...

  7. LeetCode Count Primes

    Description: Count the number of prime numbers less than a non-negative number, n. 题意:给出一个数n,求小于n的素数 ...

  8. Codeforces 617E XOR and Favorite Number

    Discription Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Eac ...

  9. 222. Count Complete Tree Nodes

    题目: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree fr ...

最新文章

  1. springBoot使用PageHelper当超过最大页数后仍然返回数据
  2. (四)Java B2B2C o2o多用户商城 springcloud架构-断路器(Hystrix)
  3. emqtt 试用(二)验证 emq 和 mosquito 的共享订阅
  4. Unity Api集合
  5. 【WiFi密码破解详细图文教程】ZOL仅此一份 详细介绍从CDlinux U盘启动到设置扫描破解
  6. 【逆强化学习-0】Introduction
  7. 数据库系统概论第五版(王珊)-系统篇(十二)
  8. Java数组快速排序
  9. 初中计算机课堂游戏设计方案,初中信息技术教案设计
  10. 网络安全——钓鱼邮件和网站克隆
  11. 机器学习--红酒质量检测分析(包含数据集,直接可用)
  12. 奇迹暖暖服务器不稳定,奇迹暖暖有几个服务器
  13. K线技术指标实现—同花顺多空趋势点
  14. 反向的css动画,动画方向 | animation-direction
  15. iOS刘海机型UI适配(X、Xs、Xs Max、Xr)
  16. 企业微信推送应用消息-图片(news)/图文(npmnews)/卡片/文字
  17. 如何用python制作三维动画_用Python制作3D动画
  18. Vibosoft ePub Converter(ePub转换器)v2.1.24官方版
  19. “因为无法从捐赠中抽成,谷歌把我的开源 App 下架了!”
  20. 【深度学习】超详细的 PyTorch 学习笔记(上)

热门文章

  1. ruby: 在Ubuntu上安装Ruby, ruby gems
  2. MYSQL 更改初始 ROOT 密码
  3. ESC/POS 打印机指令
  4. 设n是一个任意自然数,如果n的各位数字反向排列所得的自然数与n相等,则n称为回文数。从键盘输入一个5位数字,请编写程序判断这个数字是不是回文数
  5. UE4:快速入门蓝图(Blueprint)的方法之一
  6. OUC2021秋-计算机网络-期末(回忆版)
  7. 苏州嵌入式软件方向知名公司
  8. Discuz!论坛教程之去掉附件图片提示下载框方法
  9. 国内ce认证机构有哪些 国内十大CE认证机构排名 做ce认证的公司推荐
  10. tail命令,实时查看日志文件