Loading...

The Cannibalization Report

A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
hard
Seniority
staff

Problem

For each product whose first transaction occurred in the last 6 months, compare the category's total sales in the 30 days before that product's first sale versus 30 days after. Show the product name, category, pre-entry sales, post-entry sales, and the percentage change.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.