r/dataanalysiscareers • • Sep 01 '26

Learning / Training Made a SQL interview cheat sheet for data analyst interviews. What would you add?

Post image

Put together this one-page SQL revision sheet for analyst interviews.

I tried to cover the things that tend to matter beyond just remembering syntax: joins, aggregation grain, NULL handling, CTEs, window functions, common interview patterns, and mistakes that can quietly give you the wrong result.

For people who've actually done data analyst interviews, what SQL topic or question pattern would you add?

318 Upvotes

13 comments sorted by

6

u/Parking_Increase4664 Sep 02 '26

INDEX? UNION ALL, UNION, INTERSECT? CONCATENATE?

8

u/Appropriate_Sugar202 Sep 01 '26

Whatever you end up with, make a version that doesn't mention interviews. I'd print and hang this, but the interview mention is off-putting for something that could be used daily.  Great job btw!

7

u/_onelast Sep 01 '26

So just SQL cheat sheet. Nice. It’s next on my list to learn so I’ll snag this for the the future

3

u/nian2326076 Sep 02 '26

You might want to add sections on indexing and query optimization. Interviewers often check if you can make queries more efficient, especially with big datasets. Also, consider covering subqueries and how they perform compared to joins. Error handling and transaction management are good to include to show you're thinking about robustness.

I've found PracHub helpful for practicing interview questions and understanding common patterns. They have good material on SQL topics and how they might appear in interviews. Just a suggestion if you want another angle on your prep!

2

u/Competitive-Catch-23 Sep 05 '26

I use exists a lot.
Select *
From x
Where exists (select ‘t’
From v
….)

1

u/Feline_Sleepwear Sep 03 '26

I would add UNIONs as well, with that added this covers everything that came up on my entry-level interview.

Maybe add something about query optimisation as that’s something that would be likely to come up.

1

u/Street_View1936 Sep 05 '26

Anybody can teach me because I'm new here

1

u/Warm-Tea6882 Oct 01 '26

I'm just getting into data science since I'm considering majoring in it. Is this helpful for me?

0

u/[deleted] Sep 01 '26

[deleted]

2

u/S-Kenset Sep 01 '26

no the graphic is right.

2

u/Ksnku Sep 01 '26

You're listing the order of operations / execution, not order of syntax. Order of operations is a more advanced use case

1

u/Parking_Increase4664 Sep 02 '26

Yep, if we're talking about the order of execution, then the correct order will be:

FROM

WHERE

GROUP BY

HAVING

SELECT

ORDER BY