High-yield 1Z0-909 cheat sheet for MySQL 8.0 developers: SQL patterns, schema rules, indexing and EXPLAIN tips, transactions, and stored program fundamentals.
Use this for last‑mile review. The exam rewards precise SQL semantics and the ability to predict results.
col = NULL is never true; use IS NULL.NOT IN + NULLs can surprise you; prefer NOT EXISTS when NULLs are possible.1SELECT * FROM t WHERE col IS NULL;
If you filter the right side of a LEFT JOIN in the WHERE clause, you often turn it into an INNER JOIN.
1SELECT a.id, b.status
2FROM a
3LEFT JOIN b ON b.a_id = a.id AND b.status = 'ACTIVE';
For JSON fields, you often index a generated column that extracts the attribute you query frequently.
WHERE customer_id = ?)WHERE YEAR(created_at)=2025 is often non-sargable)EXPLAIN quick read1EXPLAIN SELECT * FROM orders WHERE customer_id = 123;
2SHOW INDEX FROM orders;
High-yield reminder: if you see full table scans unexpectedly, check predicate sargability, data types, and missing indexes.
1START TRANSACTION;
2UPDATE accounts SET balance = balance - 10 WHERE id = 1;
3UPDATE accounts SET balance = balance + 10 WHERE id = 2;
4COMMIT;
1CREATE VIEW active_users AS
2SELECT id, email FROM users WHERE active = 1;
1SELECT JSON_EXTRACT(payload, '$.customer.id') AS customer_id
2FROM events;
Know the difference between JSON extraction for query and for indexing (often via generated columns).
| Term | Meaning |
|---|---|
| Sargable predicate | A predicate the optimizer can use with an index efficiently. |
| Cardinality | Roughly: number of distinct values in a column (influences index usefulness). |
| Execution plan | The steps the database uses to run a query (inspect with EXPLAIN). |
| Isolation | Rules for what changes are visible across transactions (concept-level). |
| Generated column | A computed column that can be indexed (useful for JSON). |