vivekpandey76/Mysql-course
À propos
🐬 Beginner-to-advanced MySQL course — filtering, joins, subqueries, window functions, CTEs & more. Hands-on guides with copy-paste SQL on one sample database. 🎥 Full video walkthrough on YouTube.
Apprentissage et éducationProgression mesurée des étoiles
- in 24h
- +1
- in 7 days
- +2
- in 15 days
- +6
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Original🐬 MySQL — From Zero to Query Master
A hands-on, example-driven guide to writing real-world SQL in MySQL
🎥 Learn it step-by-step on YouTube → Watch the Full 20-Hour MySQL Course
⭐ Enjoying this guide?
Subscribe on YouTube for the complete video walkthrough of every topic below, and give this repo a ⭐ so more learners can find it. New lessons drop regularly — hit the bell so you never miss one.
📖 About This Repository
This is a structured, beginner-to-advanced MySQL reference built to pair with the video course. Every guide is written as a standalone lesson with clear explanations, copy-paste-ready SQL, and worked examples against a single, consistent sample database — so concepts build naturally from one part to the next.
Whether you're preparing for an interview, leveling up at work, or just starting out, work through the parts in order or jump straight to the topic you need.
🚀 Getting Started
- Set up the sample database — start with Part 0: Sample Database and run the schema + seed data in your MySQL instance.
- Follow along with the video — each guide maps to a section of the 20-hour MySQL course video.
- Practice — every query in these docs runs against the sample database, so you can experiment as you learn.
# Clone the repo
git clone https://github.com/vivekpandey76/Mysql-course.git
cd Mysql-course
# Load the sample database into MySQL, then start with docs/00-sample-database.md
📚 Course Contents
| # | Topic | Guide |
|---|---|---|
| 0 | Sample Database (schema & seed data) | Sample Database |
| 1 | Filtering Data (WHERE, operators, patterns) |
Filtering Data |
| 2 | Aggregate Functions, GROUP BY & HAVING |
Aggregate Functions & GROUP BY |
| 3 | JOINs (INNER, LEFT, RIGHT, SELF) | Joins |
| 4 | Subqueries | Subqueries |
| 5 | Window Functions | Window Functions |
| 6 | Common Table Expressions (CTEs) | Common Table Expressions |
| 7 | String, Date & CASE Functions |
String, Date & CASE Functions |
| 8 | Views (virtual tables) | Views |
| 9 | Stored Procedures | Stored Procedures |
| 10 | Triggers (automatic INSERT/UPDATE/DELETE actions) |
Triggers |
| 11 | UNION & UNION ALL (stacking result sets) |
UNION & UNION ALL |
| 12 | Recursive CTEs (hierarchies & sequence generation) | Recursive CTE |
| 13 | Indexes (single, composite, unique, prefix & EXPLAIN) |
Indexes |
🧩 Interview Practice
Real-world SQL problems with datasets, expected output, and fully explained solutions — great for interview prep and self-testing.
| Set | Focus | Link |
|---|---|---|
| 1 | Anti-joins, delivery times, running balances, distinct users, cancellation rates | Problem Set 1 |
| 2 | Self-joins & interval overlaps, top-N per group, HAVING, LEAD(), conditional aggregation |
Problem Set 2 |
| 3 | Screening-round classics: Nth-highest salary, find & delete duplicates, manager/dept comparisons, month-over-month growth | Problem Set 3 |
| 4 | Multi-table joins, median (overall & per-group), gaps-and-islands streaks (2 methods), self-UNION win-percentage |
Problem Set 4 |
| 5 | String parsing with SUBSTRING_INDEX, longest win streak, pivot & unpivot reshaping, first/last order per customer |
Problem Set 5 |
| 6 | Consecutive-day orders, "bought all products", missing IDs, NOT EXISTS + theory: GROUP BY rules, DELETE/TRUNCATE/DROP, IFNULL vs COALESCE |
Problem Set 6 |
🏆 LeetCode SQL 50
Full walkthroughs of the complete LeetCode SQL 50 study plan — all 50 problems, the fastest way to get interview-ready. Each problem includes the original LeetCode link, the schema and sample data, real verified output, a "How to approach it" breakdown, and the trade-offs behind the solution.
| Set | Problems | Focus | Link |
|---|---|---|---|
| 1 | 1–10 | WHERE logic, NULL traps, INNER vs LEFT JOIN, anti-joins, LAG(), self-joins |
Set 1 — Select & Basic Joins |
| 2 | 11–20 | CROSS JOIN scaffolding, COUNT(*) vs COUNT(col), HAVING, conditional aggregation, rates & percentages, range joins |
Set 2 — Joins & Aggregation |
| 3 | 21–30 | First-row-per-group with ROW_NUMBER(), DENSE_RANK() on ties, LEAD() retention, COUNT(DISTINCT), relational division, inclusive date windows |
Set 3 — Window Functions & First-Row Logic |
| 4 | 31–40 | Window frames (ROWS vs RANGE), running totals, 7-day moving averages, LEAD(col, n), UNION ALL for zero-count buckets, anti-joins, CASE branching |
Set 4 — Advanced Windows & Conditional Logic |
| 5 | 41–50 | String functions, word-boundary LIKE, REGEXP & case-sensitivity, GROUP_CONCAT, DELETE from a self-referenced table, top-N per group with DENSE_RANK() |
Set 5 — Strings, Regex & Set Operations |
🎁 Bonus Problems
Patterns the SQL 50 skips or only skims — the ones that actually come up in analytics and data-engineering interviews. Custom datasets, same format: schema, real verified output, approach, solution, and the failure modes to avoid.
| Set | Focus | Link |
|---|---|---|
| 1 | Rolling sums: aggregate-then-window, PARTITION BY frames, ROWS vs RANGE, recursive date spines for gappy time series |
Bonus Set 1 — The Rolling Sum Pattern |
🏢 Company-Based Questions
SQL questions candidates report from real interview rounds, grouped by company. Same format: dataset, expected output, solution, and the traps interviewers ask about.
| Company | Focus | Link |
|---|---|---|
| Accenture | Latest login per country, never-sold products, pivot/unpivot, de-duplication, rolling averages + theory: RANK vs DENSE_RANK, WHERE vs HAVING, DELETE/TRUNCATE/DROP |
Accenture SQL Questions |
| TCS | Nth highest salary, self-join managers, zero-count LEFT JOINs, top-N per group, missing IDs with recursive CTE, cloning tables, two-way routes |
TCS SQL Questions |
🗂️ Repository Structure
mysql/
├── docs/ # Lesson guides (start with 00, follow in order)
│ ├── 00-sample-database.md
│ ├── 01-filtering-data.md
│ ├── 02-aggregate-functions-and-group-by.md
│ ├── 03-joins.md
│ ├── 04-subqueries.md
│ ├── 05-window-functions.md
│ ├── 06-common-table-expressions.md
│ ├── 07-string-date-and-case-functions.md
│ ├── 08-views.md
│ ├── 09-stored-procedures.md
│ ├── 10-triggers.md
│ ├── 11-union-and-union-all.md
│ ├── 12-recursive-cte.md
│ └── 13-indexes.md
├── interview-questions/ # Practice problem sets with solutions
│ ├── problem-set-01.md
│ ├── problem-set-02.md
│ ├── problem-set-03.md
│ ├── problem-set-04.md
│ ├── problem-set-05.md
│ └── problem-set-06.md
├── leetcode-problems/ # LeetCode SQL 50 walkthroughs
│ ├── set-01-easy-basics.md
│ ├── set-02-joins-and-aggregation.md
│ ├── set-03-window-functions-and-first-rows.md
│ ├── set-04-advanced-windows-and-conditional-logic.md
│ └── set-05-strings-regex-and-set-operations.md
├── bonus-problems/ # Patterns the SQL 50 doesn't cover
│ └── set-01-rolling-sum-pattern.md
├── company-based-questions/ # Real interview questions by company
│ ├── accenture_sql_questions.md
│ └── tcs_sql_questions.md
├── assets/ # Diagrams & images
│ ├── Indexing.png
│ └── joins.png
├── LICENSE
└── README.md
🎯 Who This Is For
- Beginners learning SQL for the first time
- Developers & analysts brushing up on intermediate/advanced querying
- Interview candidates revising joins, subqueries, window functions, and CTEs
- LeetCode grinders who want the reasoning behind each solution, not just an accepted answer
🤝 Contributing
Found a typo, a bug in a query, or have a clearer example? Contributions are welcome — open an issue or submit a pull request.
📜 License
Released under the MIT License. Free to use, share, and learn from — attribution appreciated.
If this helped you, please ⭐ the repo and subscribe on YouTube. It genuinely helps! 🙌
Explorer des projets similaires
Chargement…