Seller Growth

ASKED IN INTERVIEW
4pts
Etsy, e Bay

Problem Statement

Etsy wants to spotlight sellers who are scaling their businesses rapidly. A "Breakout Seller" is defined as someone who doubled their sales volume (quantity sold) from Q1 to Q2 in the year 2025.

Write an SQL query to find these sellers.

Rules:

  • Q1: January 1, 2025, to March 31, 2025.
  • Q2: April 1, 2025, to June 30, 2025.
  • A seller must have at least 1 sale in Q1 to be considered.
  • The total quantity sold in Q2 must be >= 2 * total quantity sold in Q1.
  • Output columns: seller_id, q1_volume, q2_volume.
  • Results must be returned in descending order of q2_volume.

Table Schema:

  • Sellers: seller_id, seller_name, join_date.
  • Sales: sale_id, seller_id, quantity_sold, sale_date.
Tests your understanding of
Conditional Aggregation, Joins, Arithmetic and Date Filtering

Input Tables

Sellers
seller_id(INTEGER)seller_name(VARCHAR)
1VintageVibes
2HandmadeHaven
3CraftyCorner
4AntiqueArt
Sales
seller_id(INTEGER)quantity_sold(INTEGER)sale_date(DATE)
1102025-01-15
1252025-04-10
252025-02-20
2102025-05-05
3202025-03-01
3302025-06-01
402025-01-01
4502025-05-01

Expected Output

seller_id(INTEGER)q1_volume(INTEGER)q2_volume(INTEGER)
11025
2510

Tags

MediumASKED IN INTERVIEWConditional AggregationJoinsArithmeticDate Filtering
15-20 min
49%

Hints