Sutra

Master data analytics and financial intelligence. Actionable insights, frameworks, and deep dives for people who think in numbers.
Sydney, AU
โ€ขCreated byProfile picturensb
1 joined
Profile picture
nsbProfile picture@nsbphยทApr 19

The 3 SQL queries every aspiring data analyst should know cold

Most data analytics courses start with theory. That's backwards.


Here are 3 queries I wish someone had drilled into me on day one:


1. The Revenue Cohort

SELECT DATE_TRUNC('month', signup_date) AS cohort,
       COUNT(DISTINCT user_id) AS users,
       SUM(revenue) AS total_revenue
FROM transactions
GROUP BY 1 ORDER BY 1;

This tells you which signup cohorts are actually generating revenue. If you can't write this in your sleep, you're not ready for interviews.


2. The Retention Check

SELECT a.user_id,
       a.first_purchase,
       MIN(b.purchase_date) AS second_purchase
FROM (SELECT user_id, MIN(purchase_date) AS first_purchase FROM orders GROUP BY 1) a
LEFT JOIN orders b ON a.user_id = b.user_id AND b.purchase_date > a.first_purchase
GROUP BY 1, 2;

Retention > acquisition. Every finance team cares about repeat behavior.


3. The Moving Average

SELECT date,
       revenue,
       AVG(revenue) OVER (ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma_7d
FROM daily_revenue;

Smooths out noise. Essential for any financial reporting dashboard.


I'm building Sutra to teach this kind of practical, job-ready analytics. No fluff โ€” just the skills that get you hired.


Join free and start learning.

Profile picture
nsbProfile picture@nsbphยทApr 19
Pinned post

Welcome to Sutra ๐Ÿงต

You're in. Here's how to get the most out of this:


๐Ÿ“ฌ Posts & Insights โ€” This is where the weekly breakdowns drop. Data analytics walkthroughs, financial modeling frameworks, and the tools that actually matter. Check back every week.


๐Ÿ’ฌ Community Chat โ€” Ask questions, share what you're working on, and connect with other students who are serious about building analytical skills.


What to do right now:

  1. Drop an intro in the chat โ€” what are you studying and what do you want to learn?

  2. Save this space โ€” new content drops weekly


Let's build your edge.