Nobel Quiz
下面是Nobel
表中字段的相关信息
题目
- Pick the code which shows the name of winner’s names beginning with C and ending in n
通配符的使用
1 | select name |
- Select the code that shows how many Chemistry awards were given between 1950 and 1960
找出两个年份之间化学奖品被授予的次数
1 | select count(subject) -- 统计总数 |
- Pick the code that shows the amount of years where no Medicine awards were given
统计没有医药授予的年份,需要考虑去重
1 | select count(distinct yr) |
- 从代码中选正确结果
1 | SELECT subject, winner FROM nobel WHERE winner LIKE 'Sir%' AND yr LIKE '196%' |
- Select the code which would show the year when neither a Physics or Chemistry award was given
物理和化学同时不授予的年份
1 | select yr from nobel |
- Select the code which shows the years when a Medicine award was given but no Peace or Literature award was
找出医药授予,但是和平和文学不授予的年份
1 | select distinct yr from nobel |
- 从代码中选出正确的答案
select subject, count(subject) – 统计每个学科的数量
from nobel
where yr=‘1960’
group by subject;