Track NPS From Your Database Without SQL (2026)
Your NPS responses are already sitting in a database table. But turning them into an actual Net Promoter Score, segmented by plan or cohort, usually means asking an engineer to write SQL or exporting rows to a spreadsheet every week.
This guide shows you how to track NPS directly from your database without writing SQL: calculate the score, break it down by segment, put it on a dashboard that refreshes itself, and get alerted the moment a detractor score lands.
What You Need in Your Database
NPS tracking needs one table (or collection) of survey responses. If you collect NPS in-app or through a tool that syncs to your database, you likely already have something like this:
A responses table with: a score column (0-10), a user or customer ID, and a timestamp. Optionally a free-text comment column. That's it.
If your survey tool doesn't sync to your database, most (Delighted, Typeform, in-app widgets) can push responses via webhook into a table. Once the rows exist in PostgreSQL, MySQL, Supabase, MongoDB, or any other supported database, everything below works the same way.
The NPS Formula in 10 Seconds
Scores 9-10 are promoters. Scores 0-6 are detractors. Scores 7-8 are passives and count toward the total but nothing else.
NPS = (% promoters) minus (% detractors). The result ranges from -100 to +100. B2B SaaS medians hover around +30; anything above +50 is strong.
In SQL this is a CASE expression inside aggregates with percentage math — easy to get subtly wrong, especially around passives and date windows. In plain English it's one sentence.
Step 1: Connect Your Database
In AI for Database (aifordatabase.com), connect the database that holds your survey responses. PostgreSQL, MySQL, SQLite, MongoDB, Supabase, PlanetScale, SQL Server, and BigQuery are all supported. Connections are read-only for analytics, so nobody on the team can accidentally modify data.
The tool reads your schema automatically, so it knows your responses table, your users table, and how they join — you never have to explain the structure.
Step 2: Ask for Your NPS in Plain English
Once connected, you ask questions the way you'd ask an analyst. Real examples:
"What's our NPS for the last 90 days?" — the AI classifies promoters and detractors from the score column, applies the formula, and returns the number along with the SQL it ran, so you can verify the logic.
"Show NPS by month for the past year." — instant trend line. This is the chart your board deck needs.
"What's the NPS of customers on the Pro plan vs the Free plan?" — segmentation that would normally require a join and a grouped CASE expression, done in one sentence.
"List all detractors from the last 30 days with their comments and account owner." — the follow-up list your CS team actually works from.
Every answer includes the underlying query, so a technical teammate can audit the math once and the rest of the team can trust it from then on.
Step 3: Build a Self-Refreshing NPS Dashboard
One-off answers are useful; a live dashboard is what changes behavior. Pin your key questions to a dashboard in AI for Database and it re-runs them against live data automatically:
A typical NPS dashboard: current 90-day NPS, monthly NPS trend, response volume (a score based on 12 responses is noise, not signal), promoter/passive/detractor breakdown, and NPS by plan or customer segment.
Because it reads straight from your database, there's no weekly export, no stale spreadsheet, and no "which version is current?" conversation. The dashboard is always right because it's always live.
Step 4: Get Alerted on New Detractors
This is where database-driven NPS beats survey-tool dashboards. With action workflows, you can trigger notifications from the data itself:
Slack alert when a new response with a score of 6 or below arrives — with the customer name and comment, so CS can reach out within the hour instead of at the next monthly review.
Email digest when monthly NPS drops more than 10 points versus the prior month, or when a high-revenue account submits a detractor score.
Webhook to your CRM to open a follow-up task on the account automatically. Recovering a detractor within 24-48 hours is one of the highest-leverage retention moves a CS team can make — but only if someone actually sees the score in time.
Segments That Make NPS Actionable
A single company-wide NPS number hides more than it reveals. Because your responses live next to the rest of your customer data, you can cut the score by anything you store:
By plan tier — are your highest-paying customers your happiest? By tenure — do scores dip after month three, pointing at an onboarding cliff? By feature usage — do customers using your automation features score 20 points higher? That last one tells you exactly what to push in onboarding.
These joins are exactly the queries teams never get around to writing in SQL. In plain English, each one is a single question.
Why Not Just Use the Survey Tool's Dashboard?
Survey tools show you the score. They can't join it to revenue, plan, feature usage, or churn — that data lives in your database, not theirs. Spreadsheets can, but they go stale the moment you export.
BI tools like Metabase or Looker can do all of this, but someone has to write and maintain the SQL, and CS leads usually end up back in the request queue. Querying the database directly in natural language removes both problems: the data is always current and nobody waits on an analyst.
Common Questions
The answers below cover the questions teams ask most when moving NPS tracking into their database.
Frequently asked questions
I want to track NPS but nobody on our CS team knows SQL. What are our options?
If your survey responses sync to a database, connect it to a natural language query tool like AI for Database. Your team asks questions like "what's our NPS this quarter by plan?" in plain English and gets answers with charts. No SQL knowledge required — the AI writes and shows the query for you.
How do I calculate NPS from raw survey scores in a database?
Classify each 0-10 score: 9-10 are promoters, 0-6 are detractors, 7-8 are passives. NPS equals the percentage of promoters minus the percentage of detractors, ranging from -100 to +100. With a natural language tool you just ask "calculate NPS from the responses table for the last 90 days" and the classification and math happen automatically.
Can I get alerted when a customer gives us a low NPS score?
Yes. AI for Database's action workflows watch your database and trigger Slack messages, emails, or webhooks when conditions are met — for example, any new response with a score of 6 or below. CS can respond to detractors within hours instead of discovering them at the next monthly review.
Is NPS from my own database better than my survey tool's dashboard?
Survey tools only see the score. Your database also holds plan, revenue, tenure, and feature usage, so you can answer questions like "what's the NPS of accounts over $500/month?" — the segments that actually drive retention decisions. The tradeoff was always needing SQL to do it; natural language querying removes that.
How many NPS responses do I need before the score is meaningful?
Treat scores from fewer than roughly 30-50 responses per period as directional, not definitive — a couple of responses can swing a small sample by double digits. Track response volume alongside NPS on your dashboard, and lengthen the time window (e.g., rolling 90 days) if your monthly volume is low.