SQL Portfolio
Analysing a digital wallet's payments, lending & reconciliation with SQL
The brief
ThaiPay is a (fictional) Thai e-wallet that launched in January 2025. It lets customers top up, pay merchants by QR, transfer money, withdraw cash — and borrow through BNPL, nano-finance and personal loans.
After one year, several teams came to the data team with questions. Acting as the Business Analyst, I translated each request into precise business rules, wrote the SQL against the production-style schema, validated the output and summarised the insight for the stakeholder.
The dataset is synthetic (generated with a seeded Python script) but deliberately contains real-world problems: failed and reversed transactions, settlement breaks, churned merchants, late-paying borrowers and a money-mule pattern.
Analysis
Each case study shows the business question, the SQL I wrote, the live result and what it means.
SQL playground
Write any SELECT against the ThaiPay database. Ctrl/⌘ + Enter to run.