image.png

Preparing for a business analytics or data science interview? Make SQL part of your core preparation. You need to turn a business question into a query, get the right result, and explain your reasoning.

Knowing what a join does is a start. Writing one correctly while someone asks you questions is the skill to practise.

“Which customers bought again?” “Why did revenue drop?” “What is the best-selling product in each category?” These questions connect everyday analytical work with the SQL skills you may be asked to demonstrate in a technical interview.

This three-part series takes you from a blank editor to answering those questions.

In Part 1, we will install the tools, connect to PostgreSQL 18, prepare the complete dataset, and write our first queries. You do not need previous programming experience.

In Part 2, we will connect tables and build customer and revenue reports.

In Part 3, we will analyse growth, rank products, and understand how PostgreSQL executes a query.

Learning Guide

Before going into a SQL technical interview, complete all three posts and every exercise. Run the worked examples yourself, then attempt the exercises without looking at the solutions. Finally, repeat them from a blank SQL file and explain your choices aloud: what each row represents, why you chose that join, and how you know the answer is correct.

<aside> ✅

The goal of this series: build a practical SQL foundation you can use in analytical work and demonstrate in an interview.

</aside>

How Long Will This Take?

If you are starting from scratch, budget 20–30 hours of hands-on learning and practice for the skills covered in these three posts. This is a planning estimate, not a promise: your spreadsheet experience, comfort with technical tools, and time spent debugging will affect your pace.

Stage Suggested time What to do
Part 1: Setup and basic queries 4–6 hours Install the tools, load the data, practise filtering and grouped summaries
Part 2: Joins and business reports 6–8 hours Work through table relationships, aggregation, CTEs, and customer reports
Part 3: Window functions and performance 6–10 hours Practise rankings, date comparisons, missing months, and execution plans
Review across all three parts 4–6 hours Redo exercises without solutions and explain your reasoning aloud

Build your SQL foundation in two weeks by setting aside 2 hours every day. Spend the first 10 hours on setup, basic queries, and joins; use the rest for business reports, window functions, and revision. Work through every exercise yourself, leaving time to make mistakes, debug your queries, and retry without the solutions.

Finishing the series gives you a foundation, rather than a guarantee of passing every SQL interview. Before your interview, add unfamiliar, timed questions that match the role. **

A useful readiness check is whether you can solve a new question, handle missing values and duplicate matches, and explain how you validated the result without copying a worked example.

Situation

Imagine you help run a small online shop. Someone asks: