Advertisement
Advanced SQL & Database Querying, Advanced SQL

How do you optimize SQL queries?

Short answer

Use indexes and filter early.

Save SQL & Database Querying mock interview
Advertisement
AModel answer
Use indexes and filter early.
Example

Avoid SELECT *.

Real-world example
Window functions helped an analyst calculate running totals and rankings easily.
Likely follow-ups
  • What are window functions
  • What are CTEs
  • What are subqueries
Related topics