You're expected to think about performance.
Optimization principles:
- Filter early (WHERE before JOIN)
- Avoid SELECT * in production
- Use appropriate indexes
- Understand execution plans
Common mistakes:
- Functions on indexed columns:
WHERE YEAR(date) = 2024prevents index use - Implicit type conversions
- Unnecessary DISTINCT
- Correlated subqueries that run per-row
In interviews: Mention optimization even if not asked. "I'd add an index on X" shows senior thinking.