How to calculate Customer Satisfaction Score (CSAT)
CSAT is the percentage of customers who rate an interaction as satisfied, usually 4 or 5 on a five-point scale.
Formula
CSAT % = satisfied responses (4–5) ÷ total responses × 100SQL query
This example assumes: csat_responses(ticket_id, score, responded_at, agent_id). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
SELECT agent_id,
COUNT(*) AS responses,
COUNT(*) FILTER (WHERE score >= 4) * 100.0 / NULLIF(COUNT(*), 0) AS csat_pct
FROM csat_responses
WHERE responded_at >= DATE '2026-07-01'
GROUP BY agent_id
ORDER BY csat_pct DESC;Common mistakes that make Customer Satisfaction Score (CSAT) wrong
- Only a minority respond; the result describes responders, not all customers.
- Agents with few responses show extreme scores; show the response count.
- Changing the survey wording or scale breaks comparisons over time.
Ask for Customer Satisfaction Score (CSAT) in plain English
Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.
- What is our CSAT by month?
- Which ticket categories have the lowest satisfaction?