Learn · Practise · Query · Revise · Prepare for Interviews
A topic-wise MySQL learning repository with explanations, practical queries, sample outputs, executable SQL scripts, relational database design notes, and interview practice.
This repository organizes MySQL learning material into numbered Markdown lessons and executable .sql files.
Each lesson explains the concept, syntax, practical use, and examples. Query exercises state the question first, followed by the MySQL query and a representative result.
The topic order follows the organization of the author's Oracle SQL repository while adapting syntax and behavior to MySQL. Oracle-specific differences are identified where they help learners transition between the two systems.
- Topic-wise MySQL learning documentation.
- Beginner-to-advanced SQL concepts.
- Practical SQL queries and examples.
- Executable MySQL scripts.
- Query exercises with representative outputs.
- Database design and relational model concepts.
- ER diagrams and normalization.
- Oracle SQL and MySQL syntax comparisons.
- MySQL interview questions and answers.
- Structured learning and revision resources.
| Path | Purpose |
|---|---|
01-Introduction-to-MySQL.md |
Database history, DBMS, RDBMS, SQL and MySQL |
02-MySQL-Data-Types.md |
Data type categories, ranges and examples |
03-Retrieving-Data-SELECT-Statement.md |
SELECT, projection, filtering and DISTINCT |
04-Case-Sensitivity-in-MySQL.md |
Identifier case, string comparisons and collations |
05-Constraints-in-MySQL.md |
NOT NULL, UNIQUE, CHECK, DEFAULT, PK and FK |
06-Tables-in-MySQL.md |
CREATE, ALTER, DESCRIBE, DROP and TRUNCATE |
07-Operators-in-MySQL.md |
Arithmetic and relational operators |
08-Column-Aliases-and-Concatenation.md |
Aliases, CONCAT and expressions |
09-DUAL-Table-and-Expressions.md |
Literal expressions and Oracle DUAL differences |
10-Keywords-as-Operators.md |
DISTINCT, BETWEEN, IN, IS NULL and related predicates |
11-Like-Operator-and-Logical-Operators/ |
LIKE patterns and AND/OR/NOT |
12-ORDER-BY-Clause.md |
Sorting query results |
13-Functions/ |
Character, numeric, date, conversion and aggregate functions |
14-GROUP-BY-Clause.md |
Grouping rows and aggregate calculations |
15-HAVING-Clause.md |
Filtering groups |
16-Subqueries-or-Nested-Queries.md |
Scalar, multi-row and correlated subqueries |
17-Joins/ |
INNER, OUTER, CROSS and self joins |
18-Commands/ |
DDL, DML, TCL, DCL and SELECT |
19-Miscellaneous-Queries.md |
Mixed practice questions |
20-Database-Objects/ |
Views, indexes, procedures, triggers, events |
21-Difference-Between-Oracle-and-MySQL.md |
Practical syntax comparison |
22-ER-Diagrams/ |
ER basics, case study and schema |
23-Normalization.md |
1NF, 2NF, 3NF and BCNF |
24-Relational-Model-Assignment-Queries.md |
Relational model and SQL assignments |
25-MySQL-Interview-Questions-and-Answers.md |
Interview revision |
Source-Code/ |
Numbered, runnable MySQL scripts |
Follow this sequence to build your MySQL knowledge progressively.
- Read the numbered topic file.
- Open the related script in
Source-Code/. - Run the script in MySQL Workbench against a local MySQL Server.
- Compare the result with the expected output in the lesson.
- Try the practice questions without looking at the answers first.
- Revise the concepts before moving to the next topic.
The main practice schema uses the emp, dept, and j_grade tables from the supplied KodNest sample material.
Their MySQL definitions and INSERT statements are available in:
Source-Code/00-KodNest-Sample-Tables.sql
Additional tables such as student, station, city, and country are used only in lessons where the exercise needs them.
- Examples target modern MySQL 8.0.
- CHECK constraints are enforced in MySQL 8.0.16 and later.
- Window functions require MySQL 8.0 or later.
- Some administrative statements require suitable database privileges.
- Query behavior may vary depending on MySQL version, SQL mode, and database configuration.
Before working with the examples, make sure you have:
- MySQL Server installed.
- MySQL Workbench or another MySQL-compatible SQL client.
- Basic understanding of database concepts.
- A system capable of running MySQL.
git clone https://github.com/smbashafsdev/9.01-MySQL-Database-Notes.gitcd 9.01-MySQL-Database-Notes- Open MySQL Workbench.
- Connect to your local MySQL Server.
- Open the required
.sqlfile fromSource-Code/. - Execute the SQL statements.
- Review the query results and understand the output.
This repository is designed to help learners:
- Understand MySQL and relational database fundamentals.
- Work with MySQL data types and constraints.
- Retrieve and filter data using SELECT statements.
- Apply SQL operators and expressions.
- Work with character, numeric, date, conversion, and aggregate functions.
- Group and sort query results.
- Understand subqueries and nested queries.
- Perform different types of SQL joins.
- Work with DDL, DML, TCL, and DCL commands.
- Create and manage database objects.
- Understand relational database design.
- Learn ER diagrams and normalization.
- Compare Oracle SQL and MySQL.
- Practice SQL interview questions.
The repository includes MySQL interview questions and practical query exercises to support technical interview preparation.
Important preparation areas include:
- SQL fundamentals and database concepts.
- MySQL data types and constraints.
- SELECT statements and filtering.
- SQL operators and functions.
- GROUP BY and HAVING clauses.
- Joins and subqueries.
- Database objects.
- Transactions and database commands.
- ER diagrams and normalization.
- Practical SQL query writing.
Use the examples and exercises to strengthen both conceptual understanding and practical SQL skills.
Contributions and suggestions are welcome!
You can contribute by:
- Improving existing MySQL notes.
- Adding practical SQL examples.
- Correcting errors in queries or explanations.
- Adding new practice questions.
- Improving documentation.
- Sharing useful database design examples.
- Fork this repository.
- Clone your fork.
- Create a new branch.
- Make your changes.
- Commit your changes.
- Push your branch.
- Submit a Pull Request.
Example commands:
git checkout -b feature-name
git add .
git commit -m "docs: improve MySQL learning notes"
git push origin feature-nameThis project is licensed under the MIT License.
You are free to use, modify, and distribute the materials according to the terms of the license.
For additional information, refer to the LICENSE file included in this repository.
Shaik Mahaboob Basha
Java Full Stack Developer
Interested in Java programming, SQL, database management, and software development.
This repository is part of my learning and knowledge-sharing journey, with the goal of organizing database concepts into structured and practical learning materials.
- GitHub: smbashafsdev
- LinkedIn: Shaik Mahaboob Basha
Special thanks to:
- The MySQL Community for providing valuable learning resources.
- Oracle and MySQL Documentation for technical references.
- The SQL and database developer community.
- Open-source contributors who share knowledge and support collaborative learning.
- Developers and learners who continuously contribute to the programming community.
Learning becomes more meaningful when knowledge is shared.
MySQL is an essential technology for working with relational databases and building data-driven applications.
This repository provides a structured learning experience through topic-wise documentation, practical SQL queries, executable scripts, database design concepts, and interview preparation materials.
Whether you are a beginner learning SQL, a student strengthening your database fundamentals, or a developer preparing for technical interviews, these notes are designed to support your learning journey.
Consistent practice, experimentation, and revision are the keys to developing strong SQL and database management skills.