Complex~38min
The Referral Loop
12 accounts earned ₹1.2 lakh in referral bonuses last month. Each account has a different phone, email, and name. Finance noticed all bonus payouts went to the same bank account.
Tables you'll query
usersreferralsbonus_claimstransactions
What you'll learn
Window FunctionsCTEs (WITH clause)JOINsAggregations & GROUP BY