Routine~10min
The Negative Refund
Nine customers were charged instead of refunded. A sign-flip bug was introduced when the payment gateway switched API versions — the refund processor applied the wrong sign, so instead of ₹899 going back to the customer, ₹899 was deducted again. Four zero-amount refunds are separate: those were voided requests that never processed.
Tables you'll query
ordersrefunds
What you'll learn
SELECT & FilteringAggregations & GROUP BY