@ -0,0 +1,53 @@
-- in class examples
-- first, always see the data you are working with
SELECT * FROM employee
-- then, see the size of the data
SELECT COUNT(*) FROM employee
-- show winners of the nobel prize in 1950
SELECT yr, subject, winner FROM nobel
WHERE yr = 1950
-- show 1962 Literature prize winners
AND subject = 'Literature'
-- find nobel prizes that Albert Einstein won
SELECT yr, subject
WHERE winner = 'Albert Einstein'
-- Peace winners since 2000 inclusively
WHERE yr >= 2000
AND subject = 'Peace'
-- Good idea to show the criteria you are filtering on
SELECT winner, yr
-- Show all details (year, subject winner) of winners from 1980 to 1989 of he Literature prize
WHERE yr >= 1980
AND yr <= 1989
-- use something other than two ands - LIKE works
WHERE yr LIKE '198%'
-- and we can also try this:
WHERE yr BETWEEN 1980 AND 1989 -- this is inclusively specified