【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial

题目链接:SELECT from Nobel Tutorial

【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第1张图片
1
SELECT yr, subject, winner FROM nobel
WHERE yr = 1950
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第2张图片
2
SELECT winner FROM nobel
WHERE yr = 1962
AND subject = 'Literature'
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第3张图片
3
select yr,subject from nobel
where winner = 'Albert Einstein'
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第4张图片
4
select winner from nobel
where subject = 'Peace' and yr >= 2000
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第5张图片
5
select * from nobel 
where subject = 'Literature' 
and yr between 1980 and 1989
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第6张图片
6
SELECT * FROM nobel
 WHERE winner 
IN ('Theodore Roosevelt', 'Woodrow Wilson', 'Jimmy Carter',
'Barack Obama')
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第7张图片
7
select winner from nobel
where winner like 'John%'
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第8张图片
8
select * from nobel
where (subject = 'Physics' and yr=1980) 
or (subject = 'Chemistry' and yr=1984)
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第9张图片
9
select * from nobel
where subject not in ('Chemistry','Medicine') and yr = 1980
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第10张图片
10
select * from nobel
where (subject = 'Medicine' and yr <1910) 
or (subject = 'Literature' and  yr>=2004)
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第11张图片
11
select * from nobel
where winner = 'PETER GRUNBERG'
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第12张图片
12
select * from nobel
where winner = 'EUGENE O\'NEILL'
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第13张图片
13
select winner,yr,subject from nobel
where winner like 'Sir%'
order by yr DESC,winner
【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial_第14张图片
14
SELECT winner, subject FROM nobel
WHERE yr=1984
ORDER BY subject IN ('Physics','Chemistry'),subject,winner

你可能感兴趣的:(【SQL】8.SQLZOO练习3--SELECT from Nobel Tutorial)