Order Item Count Mode
Etsy ☯️ Medium SQL
Beginner Mode

Objective

Write a SQL query to find the most frequently occurring item count in orders (the mode).

Table Schema:

  • orders
Column Type Description
order_id INTEGER Unique identifier for each order
item_count INTEGER Number of items in the order

Task Requirements:

  • Count how often each item_count value appears across all orders
  • Identify the item_count value(s) with the highest frequency
  • If multiple item counts share the same highest frequency, return all of them
  • Sort the results by item_count in ascending order

Output columns: item_count

Examples

Example 1:

Input:

orders
item_countorder_id
31
22
33
14
35
26
47

Output:
item_count
3
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 →