Stop 15 · Interview PreparationProjects · 1/1

SQL Portfolio Project on GitHub

Part of the SQL Roadmap

In short

A certificate says you studied SQL. A clean GitHub project shows you can use it. This is the link you put on your resume and talk about in interviews.

Publish one polished end-to-end SQL project on GitHub: a clear business question, the dataset, schema notes, well-commented queries using joins, CTEs and window functions, and a README with findings.

The jaadu carefully arranges trays of colourful Indian sweets in a brightly lit glass shop window while people walking past on the street stop to look.

Think of it like this

The mithai shop window

A sweet shop in Kolkata puts its best rosogollas and sandesh in the front window, neatly arranged and lit, so people walking past understand the shop in seconds. Your GitHub repo is that window. A recruiter spends a minute or two on it, so the question, the best queries and the findings must be easy to see right away.

Watch it happen

A repo a recruiter can read in two minutes

food-delivery-sql-analysis/
README.md
data/
schema/create_tables.sql
queries/
01_cleaning.sql
02_kpis.sql
03_repeat_customers.sql
images/charts

1/5The README is the shop window: the question, the dataset, key findings and one or two charts at the top.

The big ideas

What you need to know

One clear question

'Which cities have the best repeat customers?' is better than 'analysis of food delivery data'.

Readable queries

Each file starts with a comment block: the question, the tables used and the grain. CTEs with clear names.

Show range

Use joins, CTEs, window functions and a bit of cleaning. Depth on one dataset beats five shallow projects.

README with findings

Lead with three findings in plain words, then how to reproduce. Mention what you'd do next.

How it works

From idea to published repo

  1. 1

    Question

    Pick a dataset and one business question you find interesting.

  2. 2

    Load and clean

    Create the schema, load the data and write your cleaning queries.

  3. 3

    Analyse

    Write four to six queries that answer the question from different angles.

  4. 4

    Write up

    Add charts and a README with findings, method and how to run it.

  5. 5

    Polish and pin

    Format the SQL, check it runs from scratch and pin the repo on your GitHub profile.

See it in code

Walk through the code

sql
1-- queries/03_repeat_customers.sql2-- Question: In which cities do new customers come back within 30 days?3-- Tables:   orders (one row per order), customers (one row per customer)4 5WITH first_orders AS (6  SELECT customer_id, MIN(order_date) AS first_date7  FROM orders8  GROUP BY customer_id9),10returned AS (11  SELECT f.customer_id,12         EXISTS (13           SELECT 114           FROM orders o15           WHERE o.customer_id = f.customer_id16             AND o.order_date >  f.first_date17             AND o.order_date <= f.first_date + 3018         ) AS came_back19  FROM first_orders f20)21SELECT c.city,22       COUNT(*)                                AS new_customers,23       ROUND(100.0 * AVG(r.came_back::int), 1) AS return_30d_pct24FROM returned r25JOIN customers c ON c.customer_id = r.customer_id26GROUP BY c.city27HAVING COUNT(*) >= 5028ORDER BY return_30d_pct DESC;

1/4The header comment tells a reader the question and the grain before they read any SQL.

PostgreSQL syntax, assuming order_date is a DATE. In MySQL, use DATE_ADD(f.first_date, INTERVAL 30 DAY) and CAST(r.came_back AS UNSIGNED), or just AVG(r.came_back).

Save yourself the pain

Common mistakes

Oops

Uploading one giant untitled .sql file with no README.

Do this instead

Split queries into numbered files with header comments, and lead with a README that states findings.

Oops

Using a dataset with no clear question, just 'exploring'.

Do this instead

Frame it as a business question. Recruiters remember 'which cities retain customers best'.

Oops

Committing database passwords in a config file.

Do this instead

Use environment variables and a .env.example with placeholders. Add .env to .gitignore.

Your mission

Publish your repo

~180 min

Quick check

What should a recruiter see first when they open your SQL portfolio repo?

Go deeper

  1. 1Choose a public dataset in a domain you care about.
  2. 2Organise the repo into folders for schema, cleaning, analysis and results.
  3. 3Write the README for a recruiter who will only read it for two minutes.

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge