Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, May 5, 2017

Codecademy SQL SpeedySpoon Exercise 11


select name, count(DISTINCT order_id)
from order_items
group by 1
order by 1;

-- number of people making the orders

select name, round(1.0 * count(DISTINCT order_id) /
  count(DISTINCT delivered_to), 2) as reorder_rate
from order_items
  join orders on
    orders.id = order_items.order_id
group by 1
order by 2 desc;

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts