1990 Count the Number of Experiments
题目描述:
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. 青蛙跳跳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 ...
- 【数据库系统】数据库系统学习与实践系列文章汇总目录(持续更新中)
本文属于「数据库系统」系列文章的汇总目录,这一系列着重于「数据库系统知识的学习与实践」.由于文章内容随时可能发生更新变动,欢迎关注和收藏本文以作备忘.需要特别说明的是,为了透彻理解和全面掌握数据库系统 ...
- LeetCode 204. Count Primes--从一开始的质数个数--Python解法--面试算法题
题目地址:Count Primes - LeetCode Count the number of prime numbers less than a non-negative number, n. E ...
- LeetCode 673. Number of Longest Increasing Subsequence--O(N log N )--Java,C++,Python解法
题目地址:Number of Longest Increasing Subsequence - LeetCode 做这道题目前建议先做:Longest Increasing Subsequence - ...
- LeetCode 200. Number of Islands--c++ dfs解法
LeetCode 200. Number of Islands LeetCode题解专栏:LeetCode题解 LeetCode 所有题目总结:LeetCode 所有题目总结 大部分题目C++,Pyt ...
- [LeetCode] Count Primes
Description: Count the number of prime numbers less than a non-negative number, n 解题思路 采用Eratosthene ...
- LeetCode Count Primes
Description: Count the number of prime numbers less than a non-negative number, n. 题意:给出一个数n,求小于n的素数 ...
- 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 ...
- 222. Count Complete Tree Nodes
题目: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree fr ...
最新文章
- springBoot使用PageHelper当超过最大页数后仍然返回数据
- (四)Java B2B2C o2o多用户商城 springcloud架构-断路器(Hystrix)
- emqtt 试用(二)验证 emq 和 mosquito 的共享订阅
- Unity Api集合
- 【WiFi密码破解详细图文教程】ZOL仅此一份 详细介绍从CDlinux U盘启动到设置扫描破解
- 【逆强化学习-0】Introduction
- 数据库系统概论第五版(王珊)-系统篇(十二)
- Java数组快速排序
- 初中计算机课堂游戏设计方案,初中信息技术教案设计
- 网络安全——钓鱼邮件和网站克隆
- 机器学习--红酒质量检测分析(包含数据集,直接可用)
- 奇迹暖暖服务器不稳定,奇迹暖暖有几个服务器
- K线技术指标实现—同花顺多空趋势点
- 反向的css动画,动画方向 | animation-direction
- iOS刘海机型UI适配(X、Xs、Xs Max、Xr)
- 企业微信推送应用消息-图片(news)/图文(npmnews)/卡片/文字
- 如何用python制作三维动画_用Python制作3D动画
- Vibosoft ePub Converter(ePub转换器)v2.1.24官方版
- “因为无法从捐赠中抽成,谷歌把我的开源 App 下架了!”
- 【深度学习】超详细的 PyTorch 学习笔记(上)