Interview quiz track

First 2 free Intermediate SQL

SQL – Window Functions

Practice SQL window functions commonly asked in data analyst and data engineer interviews. Cover ROW_NUMBER, RANK, DENSE_RANK, running totals, and partitioning. Write queries and receive feedback on correctness and approach. Ideal for intermediate SQL interview prep. First 2 questions are free with full feedback.

  • Level Intermediate
  • Questions 12
  • SQL
  • window functions
  • intermediate
  • interview practice

Try any track free — first 2 questions include full AI feedback. Subscribe to finish the track and unlock everything. Type or speak your answer — the first 2 questions include scoring and detailed AI feedback.

Try first 2 questions free All tracks

Sample sql – window functions interview questions

Preview 6 questions from this track in quiz order. In the full quiz you answer one at a time — type or speak — then get a score and feedback.

  1. What is the difference between ROW_NUMBER, RANK, and DENSE_RANK?

    What a strong answer includes

    Explains how each handles ties.

  2. Write a query to get the top 3 highest-paid employees in each department.

    What a strong answer includes

    Uses ROW_NUMBER or RANK with PARTITION BY department.

  3. How do you calculate a running total of sales by date?

    What a strong answer includes

    Uses SUM() OVER (ORDER BY date).

  4. Write a query to find the second-highest salary in each department.

    What a strong answer includes

    Uses a window function or subquery correctly.

  5. Explain PARTITION BY in a window function.

    What a strong answer includes

    Describes how it groups rows for the calculation without collapsing them.

  6. Write a query to rank products by sales within each category.

    What a strong answer includes

    RANK or ROW_NUMBER with PARTITION BY category.