All practice problems Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.
Data Engineering · SQL · Hard
SQL interview question: Follow the Money
How many rupees in total went out as ghost refunds? Two apps write refunds. One counts in rupees, the other in paise.
The problem
- How many rupees in total went out as ghost refunds?
You'll use: SQL (SQLite) · SELECT & WHERE · JOIN · GROUP BY · TRIM & datetime() · Data cleaning
Solve it (expert level)3–6 min · You write SQL
Show a hint
Only ghost refunds count — reuse your anti-join from Ghost Orders.
What this teaches (spoiler)
Units are part of the data. Normalise them before aggregating (and clean the unit labels too), and prefer storing money as integer paise with a single, documented unit.