Skip to content

Instantly share code, notes, and snippets.

@ambethia
Last active August 29, 2015 14:22
Show Gist options
  • Save ambethia/a694bde70d9950772e59 to your computer and use it in GitHub Desktop.
Save ambethia/a694bde70d9950772e59 to your computer and use it in GitHub Desktop.

Normal Mode

How many users are there?

SELECT COUNT(*) FROM users;

What are the 5 most expensive items?

SELECT * FROM items ORDER BY price DESC LIMIT 5;

What's the cheapest book? (Does that change for "category is exactly 'book'" versus "category contains 'book'"?)

Who lives at "6439 Zetta Hills, Willmouth, WY"? Do they have another address?

Correct Virginie Mitchell's address to "New York, NY, 10108".

How much would it cost to buy one of each tool?

How many total items did we sell?

How much was spent on books?

Simulate buying an item by inserting a User for yourself and an Order for that User.

Hard Mode

What item was ordered most often? Grossed the most money?

What user spent the most?

What were the top 3 highest grossing categories?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment