Skip to content

Instantly share code, notes, and snippets.

@jimi008
Created September 30, 2020 16:59
Show Gist options
  • Save jimi008/951d7d8b3b27029a78e3956009b9f703 to your computer and use it in GitHub Desktop.
Save jimi008/951d7d8b3b27029a78e3956009b9f703 to your computer and use it in GitHub Desktop.
Davie's Burgers Subway Ad
SELECT *
FROM orders
LIMIT 10;
-- id, user_id, order_date, restaurant_id, item_name, special_instructions
--2
SELECT DISTINCT order_date
FROM orders
ORDER BY order_date DESC
limit 20;
-- Recent data is from June 2017
--3
SELECT special_instructions
FROM orders
where special_instructions is not null
order by special_instructions ASC
limit 20;
--6
SELECT id AS '#', special_instructions AS 'Notes'
FROM orders
where special_instructions like '%sauce%';
--7
SELECT id AS '#', special_instructions AS 'Notes'
FROM orders
where special_instructions like '%door%';
--Door Code: Codecademy
--8
SELECT id AS '#', special_instructions AS 'Notes'
FROM orders
where special_instructions like '%box%';
--beat me tic-tac-toe on the pizza box for $5 tip
--9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment