Most portfolios hold a dashboard screenshot and a list of tools, so a reviewer cannot tell what the work was for. A hiring manager may open ten portfolios in one afternoon, which means each one gets a few minutes. To use those minutes well, we build a project around one question and write it up as a short case study.
Step 1: pick one business question
A good question names a person and a decision. "Which products should the shop stop discounting?" works because a shop owner could act on the answer. "Analyse sales data" does not, because it has no decision. This is a comparison problem, so the answer will be two groups placed side by side.
Step 2: choose a dataset you can inspect
- Pick data with at least two related tables, such as orders and customers, so that you practise joins.
- Pick data from a domain you understand, for example food delivery, retail or education.
- Check the licence of the dataset before you publish anything built from it.
- Avoid the most famous practice datasets, because a reviewer has seen them many times.
Step 3: check the data before you calculate
Before the analysis, we count rows, look for duplicate keys and count missing values. Reviewers notice this step, because it shows that you do not trust a number just because a query returned it.
-- 1. how many rows, and are order IDs unique?
SELECT COUNT(*) AS total_rows,
COUNT(DISTINCT order_id) AS distinct_orders
FROM orders;
-- 2. how many orders have no customer?
SELECT COUNT(*) - COUNT(customer_id) AS missing_customer
FROM orders;Step 4: run the analysis and keep the query readable
Use CTEs to give each step a name, so a reviewer can follow the logic without running anything. Below is a query for the question about discounts. It compares the revenue of discounted and full-price orders for each product.
WITH sales AS (
SELECT product_id,
CASE WHEN discount_pct > 0 THEN 'discounted' ELSE 'full_price' END AS price_type,
quantity,
quantity * unit_price * (1 - discount_pct / 100.0) AS revenue
FROM order_items
)
SELECT product_id, price_type,
SUM(quantity) AS units,
SUM(revenue) AS revenue
FROM sales
GROUP BY product_id, price_type
ORDER BY product_id, price_type;Step 5: write a one-page case study
- The question, in one sentence, and who would use the answer.
- The data: where it came from, how many rows, and what you cleaned.
- The method: the definition you used, for example what counts as a discounted order.
- The result: one table or one chart, and one sentence that states the finding.
- The limit: what the data cannot tell you, and what you would check next.
Publish the SQL next to the write-up, for example in a public repository. A reader who wants to check your work can do it in two clicks, which builds trust faster than any claim on a CV.
How many projects are enough
Three small projects are better than one large one. Choose one that uses SQL on a clean question, one that includes messy data, and one that ends in a dashboard. Each case study stays on one page, so a reviewer can read all three in ten minutes.


