Ctrl K
Data Analyst · SQL · Mid-level · Theory

You join the orders table with the payments table, and the total revenue in the report suddenly grows almost threefold. How would you look for the cause, and how would you fix it?

~4 min by voice

How to approach it

The interviewer checks whether the candidate understands join fan-out (rows multiplying in a one-to-many relationship), can diagnose it step by step rather than by trial and error, and fixes it correctly, by pre-aggregating to the right grain rather than with DISTINCT.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsYou have a query with window functions over a billion-row events table, and it takes forty minutes. How would you investigate, and what would you optimize? SeniorA query that used to run in milliseconds now takes seconds after the table grew to tens of millions of rows. How would you investigate, and what can you do about it? Mid-levelWhat are a primary key and a foreign key? And how would you model a many-to-many relationship, for example students and courses? JuniorIn which cases would you deliberately denormalize a database schema, and what's the price you pay for it? Mid-levelWhat kinds of JOIN are there in SQL, and how do they differ from each other? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min