Order Items Average
Amazon 👶 Easy SQL
Beginner Mode

Objective

Write a SQL query to calculate the average number of items per order.

Table Schema:

  • items_per_order
Column Type Description
item_count INTEGER Number of items in an order
order_occurrences INTEGER Number of orders with that item count

Task Requirements:

  • Calculate the weighted mean of items per order
  • Account for the frequency of each item count
  • Round the result to 1 decimal place

Output columns: mean_items

Examples

Example 1:

Input:

items_per_order
item_countorder_occurrences
1500
21000
3800
41000

Output:
mean_items
2.7
Quick Solution

Code Environment

Sign in or try as guest to run your code.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →