Skip to content
1 min read

PostgreSQL: 90-day churn by cohort and channel: professional prompt

Data Analysis, Excel & SQL ยท Professional sample

Analytics engineer at an online retailer building a churn cohort analysis for the growth team.

๐Ÿ’ผ Professional๐Ÿ“„ Document๐Ÿ›’ Retail & E-commerce๐Ÿ’ป Tech, SaaS & Software

PostgreSQL: 90-day churn by cohort and channel

Analytics engineer at an online retailer building a churn cohort analysis for the growth team.

Prompt ยท 1,832 chars
ROLE: You are a senior analytics engineer who writes production-quality PostgreSQL analysis and explains it to decision makers.
GOAL: Answer how 90-day customer churn differs by first-order month and acquisition channel for the VP of Growth with reproducible analysis.
CONTEXT: Data: customers(customer_id, created_at, acquisition_channel), orders(order_id, customer_id, ordered_at timestamptz, total_amount, status). Definitions: cohort = month of first completed order; churned = no completed order within 90 days after the first order; exclude cancelled and refunded orders.
AUDIENCE: Analysts who will maintain it, and the VP of Growth who needs the conclusion.
INPUTS: Use only the tables, columns and definitions given; never invent numbers; mark [validate] where data quality is unknown; no personal data in outputs.
STEPS: 1. Restate the question, metric definitions and grain. 2. Data quality checks. 3. Main analysis step by step, commented and performant. 4. Validation: reconcile to a known total; edge cases. 5. Output layout for the stakeholder (table or chart spec). 6. Interpretation template with caveats. 7. Next analyses.
CONSTRAINTS: read replica; under 30 seconds on 40M orders; UTC timestamps; only cohorts with a full 90-day window; deterministic results; handle nulls, duplicates and time zones; explain performance choices.
TONE: Precise, pragmatic, concise.
OUTPUT FORMAT: Document: summary, definitions table, quality checks, commented code or formulas, validation, output spec, interpretation, risks and next steps.
EXAMPLE: Churned = no completed order in the 90 days after the first order.
SELF-CHECK: Check: names match my schema; grain consistent; nulls handled; validation reconciles; no invented results.
FOLLOW-UP: Offer a dashboard spec or a scheduled version and ask for a row count to validate.
Make it yours
  • Replace the status values with your real ones (for example completed vs delivered).
  • Add your indexes so performance advice fits your database.
  • Change the window from 90 days if your purchase cycle is longer.
Follow-up prompts (3)

Paste follow-ups into the same ChatterMate.Ai conversation so the first result stays in context.

Sample output
Commented PostgreSQL CTE pipeline with quality checks, index advice, reconciliation, output spec and interpretation.
Commented PostgreSQL CTE pipeline with quality checks, index advice, reconciliation, output spec and interpretation. Example output; yours will differ.
Open .html .md

โœจ More prompts like this

๐Ÿงฎ Data Analysis, Excel & SQL๐ŸŽ“ Student

Excel: sleep vs midterm scores

Psychology student analysing a class survey to see whether sleep relates to exam results.

๐ŸŽ“ Education & EdTech
View
๐Ÿงฎ Data Analysis, Excel & SQL๐ŸŽ“ Student

SQL: library loans homework

Database student practising joins and GROUP BY on a library schema for weekly homework.

๐ŸŽ“ Education & EdTech๐Ÿ’ป Tech, SaaS & Software
View
๐Ÿงฎ Data Analysis, Excel & SQL๐Ÿ’ผ Professional

Excel: Q3 budget variance for the CFO

Finance analyst building a refreshable variance workbook that separates timing from permanent variances.

๐Ÿ’ฐ Finance & Fintech
View
๐Ÿ“„ Resume Builder๐Ÿ’ผ Professional

PMM to Senior PMM at a SaaS

A product marketing manager with 8 years of experience repositions for a senior PMM role owning pricing and launches.

๐Ÿ“ฃ Marketing & Advertising๐Ÿ’ป Tech, SaaS & Software
View
๐Ÿ“„ Resume Builder๐Ÿ’ผ Professional

Finance analyst to FP&A manager

A senior financial analyst with 6 years of experience frames forecasting and automation wins for a first FP&A manager role.

๐Ÿ’ฐ Finance & Fintech๐Ÿญ Manufacturing & Supply Chain
View
โœ‰๏ธ Cover Letter & LinkedIn Profile๐Ÿ’ผ Professional

Teacher to senior learning designer

A science department head pivots into corporate learning design with a letter that tackles the "only taught teenagers" objection.

๐ŸŽ“ Education & EdTech๐Ÿง‘โ€๐Ÿ’ผ HR & Recruiting
View

Build it for real in ChatterMate.Ai

Chat, Canvas apps and dashboards, Writer documents, slides and images in one workspace. Start free; no setup.

Start free

Learn it with TutorMigo.ai

A patient AI tutor for students: practise, get feedback and prepare for exams, the honest way.

Try TutorMigo.ai