8000 GitHub - riponahmed2201/Mysql-course: 🐬 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. Β· GitHub
[go: up one dir, main page]

Skip to content

About

🐬 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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐬 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 MySQL Playlist

MySQL Complete Course β€” click to watch the full playlist on YouTube

Watch on YouTube MySQL License: MIT


⭐ 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

  1. Set up the sample database β€” start with Part 0: Sample Database and run the schema + seed data in your MySQL instance.
  2. Follow along with the video β€” each guide maps to a lesson in the YouTube playlist.
  3. 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

πŸ—‚οΈ 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
β”œβ”€β”€ 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! πŸ™Œ

About

🐬 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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

0