MySQL 8

SQL / MySQL Tutorial & Reference

Tables, queries, joins, indexes, foreign keys, CTEs, and normalization.

Clear
Popular:

Tag filter: #sql Remove

MySQL 8 Learning Path

Follow the SQL / MySQL Curriculum

Read the guides in order from fundamentals to production patterns, or jump to your current skill level.

Showing 37 of 37 guides

SQL / MySQL Beginner

CREATE DATABASE and Character Set utf8mb4

How do I create a MySQL database that stores Unicode correctly?

Relational Design 7 min
SQL / MySQL Beginner

CREATE TABLE with Keys, NOT NULL, UNIQUE, and Defaults

How do I create a table with the right data types and constraints?

Relational Design 8 min
SQL / MySQL Intermediate

ALTER TABLE to Add, Modify, and Index a Column

How do I add a column to a table that already has rows?

Relational Design 7 min
SQL / MySQL Intermediate

INSERT and UPDATE Rows with an Explicit WHERE

How do I insert a user and update that same row safely?

Queries 7 min
SQL / MySQL Intermediate

DELETE a Single Row with WHERE

How do I delete one row without emptying the table?

Queries 6 min
SQL / MySQL Beginner

SELECT, WHERE, and Comparison Predicates

How do I read specific rows from a MySQL table?

Queries 7 min
SQL / MySQL Intermediate

ORDER BY with LIMIT and OFFSET Pagination

How do I page through sorted SQL results?

Queries 8 min
SQL / MySQL Intermediate

COUNT, SUM, AVG, GROUP BY, and HAVING

How do I total and filter groups in SQL?

Queries 8 min
SQL / MySQL Intermediate

INNER JOIN Across Users, Courses, and Enrollments

How do I combine matching rows from related tables?

Queries 8 min
SQL / MySQL Intermediate

LEFT JOIN to Keep Rows with No Match

How do I list every user even when they have no enrollment?

Queries 7 min
SQL / MySQL Advanced

Indexes, Composite Indexes, and EXPLAIN

How do I index a WHERE/ORDER BY so MySQL does not scan the whole table?

Integrity & Performance 9 min
SQL / MySQL Intermediate

Foreign Keys, ON DELETE CASCADE, and ON DELETE SET NULL

How do I stop orphan enrollment rows?

Integrity & Performance 8 min
SQL / MySQL Advanced

Subqueries in WHERE and in the SELECT List

How do I filter rows using a nested SELECT?

Queries 9 min
SQL / MySQL Advanced

Common Table Expressions with WITH

How do I name a subquery so a report is readable?

Queries 8 min
SQL / MySQL Advanced

Database Normalization: 1NF, 2NF, and 3NF

How do I split repeating course lists out of a user row?

Relational Design 9 min
SQL / MySQL Advanced

SQL Transactions: START TRANSACTION, COMMIT, ROLLBACK

How do I make two writes succeed or fail together?

Integrity & Performance 8 min
SQL / MySQL Intermediate

CASE Expressions in SELECT

How do I turn a status code into a label in SQL?

Queries 8 min
SQL / MySQL Intermediate

UNION of Two Result Sets

How do I stack two SELECT results in one list?

Queries 8 min
SQL / MySQL Intermediate

CREATE VIEW for a Roster

How do I save a SELECT as a view?

Relational Design 8 min
SQL / MySQL Advanced

ROW_NUMBER and SUM Over a Window

How do I rank rows without collapsing them with GROUP BY?

Queries 9 min
SQL / MySQL Intermediate

INSERT ... ON DUPLICATE KEY UPDATE

How do I insert a row or update it when the unique key exists?

Queries 8 min
SQL / MySQL Intermediate

CHECK Constraints

How do I reject a seat count outside 1 to 40 in the table itself?

Integrity & Performance 7 min
SQL / MySQL Beginner

MySQL Date Functions

How do I filter rows from the last seven days?

Queries 7 min
SQL / MySQL Intermediate

SQL EXISTS for a Membership Test

How do I find lessons that have at least one confirmed seat?

Queries 6 min
SQL / MySQL Beginner

COALESCE and NULLIF

How do I show a fallback when a column is null?

Queries 6 min
SQL / MySQL Intermediate

SQL CAST and CONVERT

How do I compare a numeric string column as a number?

Queries 6 min
SQL / MySQL Beginner

SELECT DISTINCT

How do I list each track once?

Queries 6 min
SQL / MySQL Advanced

TRUNCATE versus DELETE

When should I empty a table with TRUNCATE instead of DELETE?

Queries 6 min
SQL / MySQL Beginner

SQL BETWEEN and IN

How do I filter lessons by a seat range or a list of tracks?

Queries 6 min
SQL / MySQL Advanced

MySQL JSON Extract

How do I read a field inside a JSON column?

Queries 6 min
SQL / MySQL Advanced

SQL INTERSECT

How do I find users who both teach and enroll?

Queries 6 min
SQL / MySQL Intermediate

SQL LIKE and Escaped Wildcards

How do I search lesson titles without treating a percent sign as a wildcard?

Queries 6 min
SQL / MySQL Intermediate

CHAR_LENGTH and LENGTH

How do I measure a title in characters instead of bytes?

Queries 6 min
SQL / MySQL Beginner

LIKE search pattern

How do I search text with a keyword?

Database 1 min
SQL / MySQL Beginner

WHERE with AND / OR

How do I combine filters in SQL?

Database 1 min
SQL / MySQL Intermediate

COUNT with GROUP BY

How do I count rows per category?

Database 1 min
SQL / MySQL Advanced

Basic transaction

How do I commit or roll back multiple writes?

Database 1 min

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…