DataDriven
LearnPracticeInterviewDiscussDailyJobs

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

Domain
SQL
Difficulty
medium
Seniority
L5

Problem

The transactions table contains duplicate records. First deduplicate by keeping only the first occurrence of each transaction (the one with the lowest transaction_id when multiple rows share the same user_id, product_id, total_amount, and transaction_date). Then combine with the products table and compute the total sales amount per product category, only counting transactions where total_amount is positive.

Summary

Clear the noise. What did each category actually earn?

Practice This Problem

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

Related

  • All Practice Problems
  • Mock Interview Mode
  • SQL Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons