Temporary Table
CREATE TEMPORARY TABLE tmp_fail AS SELECT * FROM students WHERE marks < 40; lives only for this connection. When you disconnect, it disappears. Other users cannot see it.
Use it for a messy report: filter, join, then SELECT from tmp. Don’t confuse with a normal table of the same name — TEMPORARY hides the real one in that session.
Trap — expecting a temporary table to still be there tomorrow.
On the example next to this theory: Temporary Table: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
CREATE TEMPORARY TABLE … — gone when the session ends.