---
title: "How to Query Form Data With SQL"
description: "When form responses live in a relational database, answer questions with SQL, not spreadsheets. The queries that matter: filtering, aggregating, joining."
canonical_url: "https://roundpushpin.com/knowledge/query-form-data-with-sql"
---

> Index of every page on this site: [llms.txt](https://roundpushpin.com/llms.txt)

Querying form data with SQL means asking questions of your responses directly in the database — filtering, grouping, and joining them — instead of exporting a file and pivoting in a spreadsheet. It only works when responses are stored relationally, with each question as a typed column.

## Can you query form responses with SQL?

**You can when responses live in a relational database.** If a form tool stores answers as JSON blobs you have to deserialize every document first; if each question is a typed column, you query it like any other table. The difference is the storage model — see [form data architecture](https://roundpushpin.com/knowledge/form-data-architecture) for why it matters.

![A SQL query grouping form responses by plan and returning a small result table](https://roundpushpin.com/images/knowledge/diagrams/sql-query-result.png)

## What can you actually ask?

The three workhorses are filtering, aggregating, and joining:

- **Filter** to a segment: `SELECT * FROM responses WHERE role = 'Engineer' AND submitted_at > '2026-01-01'`
- **Aggregate** to a metric: `SELECT role, COUNT(*) FROM responses GROUP BY role` — PostgreSQL's aggregate functions (`COUNT`, `AVG`, `MIN`, `MAX`) turn raw rows into answers.
- **Join** to context: connect responses to your `users` or `orders` table on a shared key to analyze answers alongside the rest of your data.

## How do you analyze completion or drop-off with SQL?

**Group by question and count non-null answers.** Because each question is its own column, a query like `SELECT COUNT(question_3) / COUNT(*)::float FROM responses` gives the completion ratio for that question — the kind of drop-off analysis that is painful when the whole response is one opaque blob.

## How RoundPushPin makes responses queryable

**RoundPushPin stores every response relationally, so your data is queryable from day one — no export step, no reshaping.** Connect your own SQL client or [export to BigQuery](https://roundpushpin.com/knowledge/export-form-responses-to-bigquery) when you want to analyze form data next to everything else.

## Sitemap

See the full [sitemap](https://roundpushpin.com/sitemap.md) for all pages.
