SQL for Product Managers

Image by <a href="https://pixabay.com/users/io-images-1096650/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=4941302">Stephan</a> from <a href="https://pixabay.com//?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=4941302">Pixabay</a>

SQL has made me a better PM. Not because I’m an engineer, but because I can get answers without waiting.

Here are the 5 queries I use every week:

1️⃣ Daily active users (DAU)

SELECT DATE(created_at) as day, COUNT(DISTINCT user_id)
FROM events
WHERE event_name = 'app_open'
GROUP BY 1 ORDER BY 1 DESC LIMIT 30

Quick pulse check on health without chasing analytics.


2️⃣ Feature adoption funnel

SELECT step COUNT(DISTINCT user_id) users
FROM funnel_events
WHERE event_name IN ('view', 'click', 'complete')
GROUP BY step ORDER BY event_order

See exactly where users drop off.

3️⃣ User segmentation

SELECT segment, AVG(revenue) as arpu, COUNT(*)
FROM users
GROUP BY segment HAVING COUNT(*) > 10
ORDER BY arpu DESC

Find high-value cohorts fast.

4️⃣ Retention cohorts

SELECT cohort,
SUM(CASE WHEN days_since_signup=0 THEN 1 ELSE 0 END) as d0,
SUM(CASE WHEN days_since_signup=7 THEN 1 ELSE 0 END) as d7
FROM user_activity
GROUP BY cohort

Answer "do people stick around?"

5️⃣ NPS by plan

SELECT plan, AVG(nps_score) as score, COUNT(*) responses
FROM nps_responses
WHERE responded_at >= NOW() - INTERVAL '30 days'
GROUP BY plan

Data-backed pricing discussions.

Pro tip: Don’t try to be an engineer. Learn to read queries, modify existing ones, and ask clear questions. That’s enough for 80% of PM decisions.


What tool are you learning to level up your PM game? SQL, Python, Airtable, Notion?

Leave a Reply

Your email address will not be published. Required fields are marked *