sqlzoo에 나오는 문제들이다.
자세한 사항은 아래의 링크를 클릭해보자.
select * from nobel
where yr = 1950;
select winner
from nobel
where yr = 1962
and subject ='Literature';
select yr, subject
from nobel
where winner = 'Albert Einstein';
select winner
from nobel
where subject = 'peace'
and yr >= 2000;
select *
from nobel
where subject = 'literature'
and yr between 1980 and 1989;
select *
from nobel
where winner in ('Theodore Roosevelt', 'Woodrow Wilson', 'Jimmy Carter', 'Barack Obama');
select winner
from nobel
where winner like 'john%';
SELECT *
FROM nobel
WHERE (subject = 'physics' and yr = 1980) or (subject = 'chemistry' and yr = 1984);
select *
from nobel
where yr = 1980
and subject not in ('chemistry', 'medicine');
select *
from nobel
where (subject = 'medicine' and yr < 1910)
or (subject = 'literature' and yr >= 2004);
select *
from nobel
where winner like 'peter%'
and winner like '%berg'
select *
from nobel
where winner like 'EUGENE%'
and winner like '%neill';
select winner, yr, subject
from nobel
where winner like 'sir%'
order by yr desc, winner;
Show the 1984 winners and subject ordered by subject and winner name; but list Chemistry and Physics last.
select winner, subject
from nobel
where yr = 1984
order by subject in ('physics', 'chemistry'), subject, winner;
14번 문제... 분명 맞게 썼는데 정답처리는 안해줬다...
왜지...?