The database is where every transaction is stored permanently. SQL is the language you use to ask the database questions — and as L2, you'll be asking a lot of them.
Think of a database like a massive Excel file with multiple sheets. One sheet has all transactions. Another has all client accounts. Another has all error logs.
SQL is how you ask questions to that Excel file. Instead of scrolling through 2 million rows manually, you type a question like: "Show me all failed transactions from Alpha Bank today" — and the database gives you exactly that in seconds.
As an L2 engineer, you use SQL every time a client asks "did my transaction go through?" or your manager asks "how many transactions failed today?"
SQL stands for Structured Query Language. It's the standard way to talk to a database. You write a query (a question), the database runs it, and sends you back the data you asked for.
In fintech, the database holds everything — every transaction, every account, every status update. Without SQL you're blind. With SQL you can find any transaction, check its status, count how many failed, and generate a full report — all in seconds.
A database has multiple tables. Each table is like a sheet in Excel. For today's examples we'll use two common fintech tables. Understanding these helps you follow all the queries below.
| txn_id | client_id | amount | status | created_at |
|---|---|---|---|---|
| TXN-001 | C01 | 5000 | SUCCESS | 2024-03-15 |
| TXN-002 | C02 | 2000 | FAILED | 2024-03-15 |
| TXN-003 | C01 | 8500 | FAILED | 2024-03-15 |
| TXN-004 | C03 | 1200 | SUCCESS | 2024-03-15 |
| TXN-005 | C02 | 3300 | PENDING | 2024-03-15 |
| client_id | client_name | vpn | type |
|---|---|---|---|
| C01 | Alpha Bank | Multinet | Bank |
| C02 | Beta Wallet | Jazz PSL | Wallet |
| C03 | Gamma Finance | Jazz PSL | MFB |
| C04 | Delta Pay | Multinet | Processor |
| txn_id | client_id | amount | status | created_at |
|---|---|---|---|---|
| TXN-002 | C02 | 2000 | FAILED | 2024-03-15 |
| TXN-003 | C01 | 8500 | FAILED | 2024-03-15 |
SELECT * FROM transactions WHERE txn_id = 'TXN-9823' — instantly see if it exists, what its status is, and when it was created.| txn_id | client_name | amount | status |
|---|---|---|---|
| TXN-002 | Beta Wallet | 2000 | FAILED |
| TXN-003 | Alpha Bank | 8500 | FAILED |
| COUNT(*) |
|---|
| 2 |
| status | total |
|---|---|
| SUCCESS | 2 |
| FAILED | 2 |
| PENDING | 1 |
Yes — fully performable on Kali Linux. SQLite is built into Kali Linux — no installation needed. You create a database, insert sample data, and run all 4 queries yourself. Here is every step exactly.
Based on the queries above, this is what a clean daily transaction stats report looks like:
| Client | Total Txns | Success | Failed | Pending |
|---|---|---|---|---|
| Alpha Bank | 3 | 2 | 1 | 0 |
| Beta Wallet | 2 | 0 | 1 | 1 |
| Gamma Finance | 2 | 2 | 0 | 0 |
| Delta Pay | 1 | 0 | 1 | 0 |
Client calls: "Did transaction TXN-4421 go through?" You run SELECT * FROM transactions WHERE txn_id = 'TXN-4421' — you see status is FAILED with a timestamp. You confirm to the client in 10 seconds, no guessing.
After an outage, manager asks: "How many transactions were affected?" You run SELECT COUNT(*) FROM transactions WHERE status = 'FAILED' AND created_at = '2024-03-15' — you have the exact number in seconds.
Your lead says: "Which client had the most failures this week?" You run the GROUP BY query with a date range filter — you get a ranked list of clients by failure count. You now know which client needs priority attention.
A client says "there are transactions pending for over 2 hours." You run SELECT * FROM transactions WHERE status = 'PENDING' AND client_id = 'C02' — you see exactly which transactions are stuck, when they came in, and how long they've been waiting.