External Exam Download Resources Web Applications Games Recycle Bin

Distinct & Between

distinctinb1.sql

SELECT DISTINCT category
FROM menu

distinctinb2.sql

SELECT title
FROM menu
WHERE category IN ('salad','drinks','sushi')

distinctinb3.sql

SELECT title, calories
FROM menu
WHERE calories BETWEEN 500 AND 1000

/* BETWEEN is inclusive and equivalent to:
test >= low AND test <= high */
  1. Explain what the result from the "SELECT DISTINCT category FROM menu" tells us
  2. Show all the fields for items WHERE price IN (18.95,19.95)
  3. Show all the fields for items where the price is BETWEEN 18.95 and 21.95
  4. Order the previous query you just wrote by price DESC