Menu
Data Skills

SQL Performance Basics for Product and Data Interviews

If your next role involves SQL, be ready to explain how a query works as well as what it returns. Start with the rows it reads, the joins and the result.

Once you have written a query that returns the right result, consider how it runs. Explain what work the database needs to do and what you would check before changing the query.

What to Check in a Query

Look at how many rows the query reads, how it joins tables and how much data it returns. Use the query plan to check your explanation rather than assuming that a shorter query must be faster.