SQLZOO练习笔记-select from nobel tutorial

SELECT yr, subject, winner
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 > 1999

select * from nobel
where subject = ‘Literature’ and yr between 1980 and 1989

SELECT * FROM nobel
WHERE winner IN (‘Theodore Roosevelt’,‘Woodrow Wilson’,‘Jimmy Carter’,‘BarackObama’)

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 (yr < 1910 and subject = ‘Medicine’)
or (subject = ‘Literature’ and yr > 2003)

select * from nobel
where winner = ‘PETER GRÜNBERG’

select * from nobel
where winner = ‘EUGENE O’NEILL’

select winner, yr, subject from nobel
where winner like ‘Sir%’
order by yr desc

SELECT winner, subject FROM nobel
where yr = 1984
ORDER BY subject IN (‘Physics’,‘Chemistry’),subject,winner

猜你喜欢

转载自blog.csdn.net/yizhu007_/article/details/82945161