MySQL extensions: SQL_CALC_FOUND_ROWS (deprecated), STRAIGHT_JOIN hint, and backtick identifiers when names are reserved.
Backticks
SELECT `order`, `key` FROM reserved_names LIMIT 10;Prefer non-reserved column names in schemas to avoid backtick noise.
Practice: Run on practice.
IFNULL and COALESCE
SELECT COALESCE(notes, 'none') AS note_label FROM orders LIMIT 5;
LIMIT offset
SELECT * FROM products ORDER BY id LIMIT 10 OFFSET 20;Large OFFSET is slow—keyset pagination on indexed id is better at scale.
Important interview questions and answers
- Q: Backticks when?
A: Reserved words or special characters in identifiers. - Q: COALESCE?
A: Returns first non-NULL argument.
Self-check
- Paginate rows 21–30 with LIMIT/OFFSET.
- Why avoid huge OFFSET?
Tip: Keyset pagination beats huge OFFSET on big tables.
Interview prep
- Backticks?
Quote reserved identifiers.
- Large OFFSET?
Slow—use keyset pagination on indexed column.