Loading...
Repeated Transactions
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- senior
Problem
A fraud model flags duplicate charges. In the transactions table, for each user and product combination ordered by time, compare each transaction to the one immediately before it. If the amounts match and the time gap is 10 minutes or less, flag it as a repeated transaction. Return the count of such repeated transactions.
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.