External Exam Download Resources Web Applications Games Recycle Bin

AND OR NOT

andornot1.sql

SELECT title, category, calories
FROM menu
WHERE category == 'burger' 
  AND calories == 920

andornot2.sql

SELECT title, category, calories
FROM menu
WHERE category == 'burger' 
  OR calories == 920

andornot3.sql

SELECT title, category, price
FROM menu
WHERE category == 'burger'
  AND NOT price == 19.95
  1. Explain the difference in results between the first two examples above (AND vs. OR).
  2. What happens if you take the NOT out of the last example?
  3. Show all the fields for items that are categorized as either "burger" OR "salad"
  4. Show the title and description for the item that is $19.95 AND has exactly 520 calories
  5. Show the title and description for the item(s) that are EITHER $19.95 OR NOT HAVING exactly 520 calories