MySQL
Speak SQL: store, query and connect data in the world’s most popular open-source database.
A complete, job-ready path through MySQL 8. Install the server and clients, design tables with the right data types and constraints, and write everyday SQL with confidence. Then level up with joins of every kind, subqueries, CTEs, window functions and views, learn to design normalised schemas, make queries fast with indexes and EXPLAIN, keep data safe with transactions and locking, automate with stored procedures, triggers and events, and run MySQL in production: users and privileges, backups, JSON, full-text search and replication.
31 lessons ~7 h 59 min Beginner → Advanced
What you’ll learn
- Install MySQL 8, connect with the mysql client and create databases and tables
- Choose correct data types and enforce data quality with constraints and foreign keys
- Insert, update, delete and query data with SELECT, WHERE, ORDER BY, LIMIT and built-in functions
- Summarise data with aggregates, GROUP BY and HAVING, and combine tables with every kind of JOIN
- Write subqueries, UNIONs, CTEs (including recursive ones), window functions and views
- Design normalised schemas (1NF–3NF) and model one-to-many and many-to-many relationships
- Speed up queries with the right indexes and read EXPLAIN plans
- Use transactions, isolation levels and locking correctly under concurrency
- Write stored procedures, functions, triggers and scheduled events
- Secure, back up, restore and replicate a MySQL server; store JSON and run full-text searches
Syllabus
6 modules · 31 lessons- 1Introduction to databases & MySQLRelational databases, tables, rows, columns and keys, and your very first database. 12 min
- 2Installing MySQL 8 & clientsInstall MySQL Server on Linux, macOS or Windows, secure it, and connect with the mysql client or a GUI. 15 min
- 3Databases & tables: CREATE, ALTER, DROPCreate databases with utf8mb4, define tables, change them with ALTER TABLE and remove them safely. 16 min
- 4Data typesIntegers, DECIMAL vs FLOAT, CHAR vs VARCHAR, TEXT, DATE/DATETIME/TIMESTAMP, ENUM, BOOLEAN and JSON. 16 min
- 5INSERT, UPDATE & DELETEAdd, change and remove rows safely, including multi-row inserts, upserts and safe-update habits. 15 min
- 6SELECT: reading dataChoose columns, compute expressions, rename with aliases, remove duplicates and limit results. 12 min
- 7WHERE, operators, ORDER BY & LIMITComparison and logical operators, IN, BETWEEN, LIKE, NULL checks, sorting and pagination. 16 min
- 8String, numeric & control-flow functionsCONCAT, SUBSTRING, REPLACE, ROUND, MOD, IFNULL, COALESCE, IF and CASE expressions. 15 min
- 9Date & time functionsNOW, CURDATE, DATE_FORMAT, DATE_ADD, DATEDIFF, TIMESTAMPDIFF, EXTRACT and time zones. 14 min
- 10Aggregates, GROUP BY & HAVINGCOUNT, SUM, AVG, MIN, MAX, grouping rows, filtering groups and WITH ROLLUP. 16 min
- 11Constraints: keys, UNIQUE, CHECK & DEFAULTPRIMARY KEY, FOREIGN KEY with ON DELETE/UPDATE, UNIQUE, NOT NULL, CHECK and DEFAULT. 16 min
- 12JOINs: combining tablesINNER, LEFT and RIGHT joins, table aliases, multi-table joins and finding unmatched rows. 16 min
- 13Self joins, CROSS JOIN & FULL OUTER emulationJoin a table to itself, build combinations with CROSS JOIN, emulate FULL OUTER JOIN and use USING. 14 min
- 14Subqueries & correlated subqueriesScalar, list and table subqueries, IN, EXISTS, ANY/ALL, derived tables and correlated subqueries. 17 min
- 15UNION, INTERSECT & EXCEPTStack result sets with UNION and UNION ALL, and find overlaps and differences in MySQL 8.0.31+. 12 min
- 16CTEs & recursive CTEsReadable queries with WITH, chaining CTEs, and walking hierarchies and series with WITH RECURSIVE. 16 min
- 17Window functionsOVER, PARTITION BY, ROW_NUMBER, RANK, running totals, LAG/LEAD and frame clauses. 18 min
- 18ViewsSave queries as virtual tables, updatable views, WITH CHECK OPTION and using views for security. 12 min
- 19Normalisation & schema design1NF, 2NF and 3NF with worked examples, modelling relationships, naming and when to denormalise. 18 min
- 20IndexesHow B-tree indexes work, creating single and composite indexes, the leftmost-prefix rule and covering indexes. 17 min
- 21EXPLAIN & query optimisationRead EXPLAIN and EXPLAIN ANALYZE, spot full scans and filesorts, and rewrite slow queries. 18 min
- 22Transactions, ACID & isolation levelsSTART TRANSACTION, COMMIT, ROLLBACK, savepoints, autocommit, ACID and the four isolation levels. 17 min
- 23Locking & concurrencyRow locks, SELECT … FOR UPDATE / FOR SHARE, NOWAIT, SKIP LOCKED, deadlocks and how to avoid them. 16 min
- 24Stored proceduresDELIMITER, IN/OUT parameters, variables, IF/CASE, loops, cursors and error handlers. 18 min
- 25Stored functionsCREATE FUNCTION, DETERMINISTIC, using your own functions in queries and when to prefer procedures. 12 min
- 26Triggers & scheduled eventsBEFORE/AFTER triggers with NEW and OLD, audit logs, SIGNAL, and the event scheduler. 16 min
- 27Users, privileges & securityCREATE USER, GRANT, REVOKE, roles, least privilege, authentication plugins and SQL injection. 17 min
- 28Backup & restoremysqldump for logical backups, restoring, consistent dumps, binary logs and point-in-time recovery. 15 min
- 29JSON columnsStore, query and update JSON with ->, ->>, JSON_EXTRACT, JSON_TABLE, and index it with generated columns. 16 min
- 30Full-text searchFULLTEXT indexes, MATCH … AGAINST in natural-language and boolean modes, relevance and limits. 13 min
- 31Replication & performance basicsBinary logs, source/replica replication with GTIDs, the buffer pool, slow query log and key settings. 18 min