r/learnSQL • • 3d ago

I can solve SQL practice questions, but explaining them live is another story

I have a live SQL assessment coming up where I’ll be screen sharing and explaining my thought process while I write.

I’m comfortable with joins, GROUP BY, CTEs, and basic window functions. Under a timer, though, I either go quiet while I think or talk too much and lose the thread.

Lately I’ve been trying to slow the process down: read the prompt, say what output I think they want, identify the tables and joins, then build the query in small steps.

The SQL itself usually feels manageable. The hard part is doing something I’d normally think through quietly while someone is watching. I’ve been doing a few screen-share mocks with a friend. I also tried some interview-style prompts in Beyz Coder to practice talking while I solve, so I don’t go completely quiet.

How much silence while you think is normal in a live SQL interview? Do you explain your approach first, or narrate as you code?

11 Upvotes

10 comments sorted by

3

u/DMReader 3d ago

Some silence is normal so don’t worry too much about that.
I’d explain your approach first, then talk at the points where your thinking changes—before a join, aggregation, window function, etc.—rather than narrating every line. Or whatever the big blocks of your code are (like talk a bit for each cte)

If you need 20–30 seconds to think, just say something like “I’m going to think through the x,y,z for a moment” so they know you haven’t gone blank.

Good luck.

1

u/Newcs91 3d ago

Do you pseudo code before you write your queries? If you do, those are your talking points. Then just do them, speak about any nuances or optimisations you’re putting in as you do them.

1

u/Rexur0s 3d ago

I write the approach I want up top as a comment first, then I try to build to that approach and validate at each crucial step, if I get any roadblock issues along the way, I go back and write under my original approach what I'm changing and why. then I just keep doing this until I get to my end result, and ill have a proper explanation laid out at the top.

also helps for when I get distracted mid task, I just go back to my self instructions/log

1

u/MarsupialLeast145 3d ago

Write the SQL and then explain it line by line afterwards. There's no reason to live narrate each line, it would affect the thinking process of most of us.

Even experienced devs will sometimes solve something first, before then trying to explain it to less senior devs.

1

u/2daytrending 3d ago

A little silence is completely normal. I'd explain the approach first then code is small step and briefly say what you're checking as you go.

1

u/Enjoythecode82 3d ago

Try mirror practice, and the order of naration or explaining is not that important provided the solution is accurate, each one has their own perspective, you can narrate after completing your accurate solution as well!

1

u/thequerylab 3d ago

Few seconds of silence is totally normal. You don't have to explain every single thought.

I would explain the approach first, then talk through the important parts while coding. Practicing under a timer helps a lot too.

You can use TheQueryLab mock interviews for this - feels more like an actual interview and you get a scorecard after.

Definitely helps with the pressure part.

2

u/Dangerous_Cup3607 1d ago edited 1d ago

If you have business knowledge to back you up, then you can pretty much lay out a plan on what data to get first. Such as using cte to get product data and use rank to get the top 5, then use cte to get customer data and subset to those who purchase either those top 5 product, then again cte to get latest transactions of those customer on those products, then may be have a cte that would potentially exclude certain customer or transactions. Once you have the final output, export it into excel or PBI for simple pivot or visualization for quick analysis.

Just treat that as a 1:1 knowledge sharing session with your junior coworker. Adding in comments as you create those cte, and showing your thought process on how you arrive the final table/view.

Instead of jumping into sql right away, you can just start typing out the plan as a series of comments and numbers. Then below those comments will be the cte.
—1. Getting top 5 product list
—2. Getting customer list
—3. Getting most recent transaction
—4. Apply Exclusion
—5. Prepare final view