Customer lifetime value (LTV) is one of the most important numbers in your business. It tells you how much revenue each customer generates before they churn — and whether your acquisition costs actually make sense.
The problem: your LTV data lives in your database. Your transactions, subscriptions, cancellations, and plan changes are all stored there. But most teams can't access that data without writing SQL or waiting on an engineer.
This guide shows you how to calculate LTV directly from your database in plain English — no SQL required, no data analyst needed.
Why Your LTV Calculation Is Probably Wrong
Most teams calculate LTV from exported data or inside tools like Stripe's dashboard. Both have the same flaw: they give you aggregate numbers, not queryable segments.
Stripe's LTV estimate doesn't tell you: LTV broken down by acquisition channel, LTV for customers who started on a free trial vs. paid directly, LTV for a specific pricing plan, or how LTV has changed for cohorts over time.
That level of analysis requires your actual database — where your subscriptions, events, and customer attributes all live together. Getting to those numbers usually means waiting on engineering. That's the bottleneck this guide helps you remove.
What You Actually Need to Calculate LTV
LTV = Average Revenue per Customer × Average Customer Lifespan. To calculate this from a database, you need a few things:
If you're on PostgreSQL, MySQL, Supabase, or any standard relational database — this data is already there. The gap is that most non-technical team members can't query it without SQL.
Option 1: Query Your Database in Plain English
If you connect your database to aifordatabase.com, you can ask questions like these directly in a chat interface:
aifordatabase connects to your PostgreSQL, MySQL, Supabase, MongoDB, or other database and translates your plain-English questions into SQL automatically. You see the answer — not the query. No setup beyond connecting your database is required.
You can also save common LTV queries as dashboard tiles that refresh automatically, so your team always sees current numbers without anyone running a query each time.
How to Set It Up
What to Actually Ask (With Examples)
Here are specific natural-language questions that work well for LTV analysis. If your database has the relevant columns, these will work as-is:
Basic LTV by signup cohort
"Show me average total revenue per customer grouped by the month they signed up" — this gives you a cohort LTV table that shows whether newer customers are worth more or less than older ones.
LTV by plan
"What is the average customer lifetime in days for customers on the Pro plan vs. Starter plan?" — useful for deciding where to focus retention effort and what to push users toward.
Churned customer LTV
"For customers who churned in the last 90 days, what was their average lifetime revenue?" — helps you understand whether you're losing high-value or low-value customers.
Acquisition source comparison
"Compare average revenue per customer for customers acquired from organic search vs. paid ads" — this one requires an acquisition_source column in your users or customers table, but if it's there, aifordatabase can query it directly.
Option 2: Ask Your Engineer Precisely
If you don't want to set up a new tool, you can unblock yourself by giving your engineer a specific, well-defined request instead of "can you calculate our LTV?"
Give them this: "I need a query that shows average total revenue per customer, grouped by signup month. Join the subscriptions and payments tables on customer_id. Filter to customers who signed up between [date range]. Return month, customer count, and average LTV."
Specific requests get faster turnaround. The more detail you provide, the less back-and-forth. The bottleneck isn't engineering capacity — it's usually unclear requirements.
Option 3: BI Tools (and Where They Fall Short)
Tools like Metabase, Tableau, or Looker can run LTV queries — but they require someone to set up the data model and build the report first. For most small teams, that's a multi-week project that never quite happens.
Natural language database tools are faster for ad-hoc LTV questions. If you're running weekly LTV reviews and need scheduled reports, a full BI setup makes sense. If you need to answer "what's the LTV of annual plan customers?" today, natural language is faster.
LTV Segmentation: Where It Gets Actionable
Once you can query your database freely, LTV segmentation becomes practical without engineering involvement:
These are questions your team should be able to answer in minutes. If they currently take weeks, the bottleneck is database access, not analysis complexity.