You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A live "proof of work" tracking daily query practice, MySQL 8 engine fundamentals, and hands-on database projects.
About This Repo
This is a multi-project MySQL learning repo. Each main project is a real, production-grade database system built step-by-step from isolated practice queries. Finish all questions → build each module → wire them into the final runnable schema + procedure pipeline. Complete one main project, then move to the next.
This repo targets MySQL 8+ specifically — DELIMITER-based stored procedures, AUTO_INCREMENT, InnoDB engine semantics, JSON functions, generated columns, window functions, and the EVENT scheduler. It is deliberately not portable/ANSI SQL.
Current progress: 🔨 Project 1 — MySQL Ledger Analytics Engine | Questions 1–20 | 5 modules
🐬 Project 1 — MySQL Ledger Analytics Engine · pro-final-mysqlledger
What you'll achieve: Build a complete InnoDB ledger from scratch. A small personal-finance schema (accounts, transactions, double-entry ledger_entries) grows a reporting view, a generated validation column, and a safe upsert pattern; gains a role-based masking layer that hides sensitive columns per role; produces pivot tables, running balances, and ranked leaderboards; and finally becomes self-maintaining with a stored procedure that recomputes balances and a trigger that writes every status change to an audit log. A real, demonstrable portfolio piece for anyone learning production MySQL.
Build path:1.1 MySQL Fundamentals → 1.2 Schema Normalizer → 1.3 Access Control → 1.4 Analytics Engine → 1.Final MySQL Ledger
📦 1.1 — MySQL Fundamentals · pro-1-mysql-fundamentals ┆ ques 1–6 ┆ 🔽 click to open
What you will gain: You build query fluency against a real InnoDB schema — filtering and sorting with LIMIT, multi-table joins, GROUP BY/HAVING, correlated subqueries, a MySQL 8 WITH CTE, and your first window function. Every later module in this project queries the same accounts/transactions/ledger_entries tables you learn here.
📦 1.2 — Schema Normalizer · pro-2-schema-normalizer ┆ ques 7–10 ┆ 🔽 click to open
What you will gain: You extend the base schema with production InnoDB patterns — a new FK-constrained, AUTO_INCREMENT table, a unified reporting VIEW, a self-validating generated column, and the INSERT ... ON DUPLICATE KEY UPDATE upsert idiom every MySQL backend relies on to keep summary tables in sync.
📦 1.3 — Access Control · pro-3-access-control ┆ ques 11–13 ┆ 🔽 click to open
What you will gain: You build a security layer that controls exactly what data each MySQL role can see — a masking VIEW, a documented least-privilege GRANT script defining real roles, and a reusable masked-column string expression. These are the exact patterns a regulated fintech ledger needs before any analytics layer touches customer PII.
📦 1.4 — Analytics Engine · pro-4-analytics-engine ┆ ques 14–18 ┆ 🔽 click to open
What you will gain: You turn raw transaction and ledger data into real business intelligence — a CASE-based pivot, running balances via window functions, RANK()/DENSE_RANK() leaderboards, a multi-key sorted report, and a JSON-column aggregate report using MySQL's native JSON functions.
⭐ 1.Final — MySQL Ledger Analytics Engine · pro-final-mysqlledger ┆ ques 19–20 + all above ┆ 🔽 click to open
What you will gain: You wire all 4 modules into one self-maintaining system. CALL rebuild_account_balances(); recomputes the ledger's balances from raw entries, and an AFTER UPDATE trigger silently logs every account status change to an audit table. After this you will have a complete, demonstrable InnoDB pipeline — a real portfolio piece that shows you can design and build production-grade MySQL systems end-to-end.