Course Overview & Sample Database
What this MySQL course covers, how to use it, prerequisites, and the sample database used throughout.
Track: Computer Science → Database / SQL → MySQL Level: Absolute Beginner → Intermediate → Advanced → Expert / Practical
Audience: Students, engineers, developers, testers, embedded and automotive engineers, and professionals who use databases in real-world applications
MySQL versions covered: MySQL 8.0 and MySQL 8.4 LTS (notes for 5.7 and 9.x Innovation releases where behavior differs)
Course Overview
MySQL is the world's most widely deployed open-source relational database. It powers websites and SaaS products, back-office systems, analytics pipelines, test-management tools, IoT platforms, and engineering data stores such as vehicle diagnostic and test-result databases.
This course teaches MySQL from the ground up and goes deep into the parts that are specific to MySQL: installation and configuration, the InnoDB storage engine, MySQL data types and SQL modes, character sets, stored programs, JSON, full-text search, partitioning, security, backup and recovery, replication and high availability, and performance tuning with EXPLAIN, the Performance Schema, and the sys schema.
What MySQL is, installation, the mysql client, databases and tables, data types, character sets, constraints, data modification, SELECT, functions, grouping
Joins, subqueries, set operations, CTEs, window functions, views, indexes, transactions and locking, storage engines and InnoDB internals
Stored procedures and functions, triggers, events, JSON, full-text search, spatial data, generated columns, partitioning, users and security, SQL injection, backup and recovery, replication and HA, query optimization, server tuning and monitoring, schema design Expert / Practical
Connecting applications, automotive and embedded use cases, projects, troubleshooting, best practices, versions and upgrades, interview questions, exercises, cheat sheet, final quiz, roadmap and checklist How to Use This Course
Install MySQL (Module 2) before reading further, and run every example.
Load the course sample database (below). Most examples use it, so you can verify every result.
Complete the practice questions at the end of each module.
Build at least two projects from Module 37.
Relationship to the SQL Course EngiLipi also has SQL — Complete Course, which teaches SQL in a database-independent way and compares dialects. This MySQL course is self-contained, but where a general SQL concept (such as normalization theory) is covered in depth in the SQL course, this course summarizes it and concentrates on how MySQL implements it.
Learning Objectives
By the end of this course you will be able to:
Explain what MySQL is, how its client-server architecture works, and when to choose it.
Install, configure, start, stop, secure, and connect to MySQL on Windows, Linux, macOS, and Docker.
Use the mysql command-line client, MySQL Workbench, and MySQL Shell productively.
Create databases and tables with correct MySQL data types, character sets, collations, and constraints.
Insert, update, delete, upsert, and bulk-load data safely.
Write MySQL queries with filtering, sorting, functions, grouping, joins, subqueries, CTEs, and window functions.
Design and use InnoDB indexes (clustered, secondary, composite, prefix, functional, full-text, multi-valued).
Use transactions correctly and understand InnoDB's MVCC, isolation levels, row/gap/next-key locks, and deadlocks.
Write stored procedures, functions, triggers, and scheduled events.
Store and query JSON, full-text, and spatial data.
Secure MySQL with users, roles, privileges, TLS, and password policies, and prevent SQL injection.
Back up and restore MySQL, including point-in-time recovery with binary logs.
Set up replication and understand Group Replication and InnoDB Cluster.
Diagnose and tune slow queries and server performance.
Connect MySQL to applications written in Python, Java, Node.js, PHP, C#, and C/C++.
Apply MySQL to engineering data such as vehicle diagnostics, CAN logs, and test results.
Prerequisites
Basic computer skills and familiarity with a terminal or command prompt.
No prior database knowledge is required.
Programming knowledge helps in Modules 29 and 35 but is not required elsewhere.
A computer with at least 4 GB RAM and 2 GB free disk space (or access to a cloud MySQL instance).
The Course Sample Database
Most examples from Module 8 onward use this small company database. Run the script once after installing MySQL (Module 2).
Facts to remember:
Used to demonstrate Kiran (emp 7) has no department (dept_id NULL) NULL in joins and grouping Finance (dept 4) has no employees LEFT/RIGHT joins, anti-joins Asha (emp 1) has no manager Root of the hierarchy Diya (customer 4) has no email IS NULL, IFNULL, COALESCE Elena (customer 5) has no orders NOT EXISTS, LEFT JOIN anti-join
Standing Desk (106) was never ordered and has 0 stock Unmatched rows, division by zero Neha and Meera both earn 95000 RANK vs DENSE_RANK ties
erDiagram
DEPARTMENTS ||--o{ EMPLOYEES : "has"
EMPLOYEES ||--o{ EMPLOYEES : "manages"
CUSTOMERS ||--o{ ORDERS : "places"
ORDERS ||--|{ ORDER_ITEMS : "contains"
PRODUCTS ||--o{ ORDER_ITEMS : "appears in"CREATE DATABASE IF NOT EXISTS eh_company
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_ai_ci;
USE eh_company;
CREATE TABLE departments (
dept_id INT UNSIGNED NOT NULL,
dept_name VARCHAR(50) NOT NULL,
location VARCHAR(50) NOT NULL,
PRIMARY KEY (dept_id),
UNIQUE KEY uq_departments_name (dept_name)
) ENGINE = InnoDB;
CREATE TABLE employees (
emp_id INT UNSIGNED NOT NULL,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
dept_id INT UNSIGNED NULL,
manager_id INT UNSIGNED NULL,
job_title VARCHAR(50) NOT NULL,
salary DECIMAL(10,2) NOT NULL,
hire_date DATE NOT NULL,
PRIMARY KEY (emp_id),
UNIQUE KEY uq_employees_email (email),
KEY ix_employees_dept (dept_id),
KEY ix_employees_manager (manager_id),
CONSTRAINT fk_employees_dept FOREIGN KEY (dept_id) REFERENCES departments (dept_id),
CONSTRAINT fk_employees_manager FOREIGN KEY (manager_id) REFERENCES employees (emp_id),
CONSTRAINT chk_employees_salary CHECK (salary > 0)
) ENGINE = InnoDB;
CREATE TABLE customers (
customer_id INT UNSIGNED NOT N
…