A Common Table Expression (CTE) in MySQL is a temporary result set that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement.
Think of it as a temporary view that exists only for the duration of that single query. It allows you to write cleaner, more readable SQL by breaking down complex queries into smaller, modular building blocks.
CTEs were introduced in MySQL 8.0, so you will need that version or higher to use them.