# Kenya Digital Payments Analytics — SQL Portfolio Project
**Author:** Philis Karuga
**Database:** MySQL
**Data Source:** Central Bank of Kenya (CBK)
**Period Covered:** 2004–2026
---
## Project Overview
This project analyses Kenya's digital financial ecosystem using two official datasets published by the Central Bank of Kenya (CBK):
1. **Mobile Payments** — Monthly M-Pesa and mobile money statistics (Apr 2007 – Apr 2026), covering active agents, registered accounts, and transaction volumes/values.
2. **Diaspora Remittances** — Monthly inflows from the Kenyan diaspora (Jan 2004 – Apr 2026), broken down by corridor: North America, Europe, and Rest of World.
The analysis explores how Kenya's mobile money infrastructure grew alongside rising diaspora inflows — two of the most important drivers of financial inclusion in East Africa.
---
## Business Questions Answered
| # | Question | SQL Concepts |
|---|---|---|
| 1 | How have M-Pesa transaction volumes grown year-on-year? | CTE, LAG(), aggregate functions |
| 2 | Which months consistently see peak mobile money activity? | GROUP BY, CASE WHEN, AVG |
| 3 | What is the rolling 12-month average for remittance inflows? | Window frame (ROWS BETWEEN) |
| 4 | Which remittance corridor grew fastest over time? | CTE, LAG(), NULLIF |
| 5 | Did mobile money adoption accelerate during COVID-19 (2020–2021)? | CASE WHEN, date filtering |
| 6 | How do mobile money values and remittances move together? | JOIN across tables |
| 7 | Year-on-year remittance growth by corridor | LAG(), window functions |
| 8 | Did the agent network or account base lead adoption? | CTE, ratio analysis |
| 9 | Which months are the best and worst for remittances each year? | RANK() PARTITION BY |
| 10 | How has the corridor share of total remittances shifted over time? | ROLLUP, conditional aggregation |
---
## Key Findings
- **M-Pesa transaction value grew from KSh 0.06B (Jun 2007) to over KSh 700B per month by 2026** — a ~10,000× increase in und …