# Given:
the_order = Order.sample
the_product = Product.sampleCan you write code to answer each question?
Hint: Each answer can be written with one line of code.
-
How many customers do we have?
-
What is the most expensive thing we sell?
-
What is the subtotal of the_order (cost all items excluding shipping)?
-
How much does the average customer spend per order?
-
How many items in the_order cost more than $100?
-
How many different products were purchased in the_order?
-
How many times has the_product have been ordered?
-
How many orders contain the_product?
-
How many people bought the_product?
Extra Credit: (these might require more than one line of code)
-
What's the most popular product we sell?
-
On average, how many items are purchased in a typical order?