GUIDE

Claude Code for Data Pulls (Without SQL)

PMs wait days for basic data requests. Claude Code connects to your Postgres or BigQuery database via MCP servers and answers questions in plain English, no SQL required.

The data you need is sitting in your database right now. You just can't get to it without opening a ticket. Every PM knows the pain: you have a question about signups, conversion rates, or feature adoption, and the answer lives in Postgres or BigQuery. But you don't write SQL, so you file a Jira ticket, wait 2-5 days, get a CSV that half-answers your question, file a follow-up, and wait again.

I've trained over 100 people on Claude Code. For PMs, the single biggest win is connecting it to their database with an MCP server. You ask questions in plain English. Claude writes the SQL, runs it, and hands you formatted results. No tickets. No waiting. No learning SQL syntax.

How This Works (The 30-Second Version)

Claude Code supports MCP servers, which are small programs that give Claude access to external tools. One of those tools is a Postgres MCP server that lets Claude query your database directly. You type "How many users signed up last month?" and Claude translates that into SQL, runs it against your database, and returns the answer.

The same pattern works for BigQuery, MySQL, and other databases. The setup takes about 10 minutes. After that, your database is a conversation away.

Setting Up the Postgres MCP Server

You'll need a Postgres connection string. Ask your data team or DevOps for a read-only connection (more on why later). Then add the MCP server to your Claude Code configuration.

Open your Claude Code settings file at ~/.claude.json (global) or .claude/settings.json (project-level) and add:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://readonly_user:password@your-host:5432/your_db"
      ]
    }
  }
}

Restart Claude Code after saving. Claude will connect to the MCP server on startup and discover the available database tools. You'll see a message confirming the connection. That's it for setup.

Your First Data Pull

With the MCP server connected, just ask your question in plain English:

How many users signed up last month?

Claude figures out which table holds user data (it can inspect the schema), writes the SQL, runs it, and returns something like:

I queried the users table for signups in February 2026.

Total new signups: 1,247

Here's the breakdown by week:
- Week 1 (Feb 1-7):   298
- Week 2 (Feb 8-14):  312
- Week 3 (Feb 15-21): 287
- Week 4 (Feb 22-28): 350

The last week saw a 22% increase over week 3, likely
correlated with the launch campaign that went live Feb 20.

Claude didn't just return a number. It broke the data down by week and flagged a trend. You can follow up immediately: "What percentage of those signups came from organic search vs paid?" Claude writes another query and answers in seconds.

Real Examples PMs Actually Ask

Here are prompts I've seen PMs use in my ClaudeFluent training. Each one would normally require a Jira ticket and a 2-day wait:

What's the conversion rate from free trial to paid,
broken down by plan tier, for the last 3 months?
Which features have the lowest adoption rate among
users who signed up in Q4? Show me the bottom 10.
How many support tickets were created last month,
grouped by category? Which category grew the most
compared to the previous month?
What's the average time from signup to first
meaningful action (creating a project), broken
down by acquisition channel?
Show me all accounts on the Enterprise plan that
haven't logged in for 30+ days.

Every one of those gets answered in under 30 seconds. No SQL knowledge required. Claude handles joins, aggregations, date math, and formatting automatically.

What the Output Actually Looks Like

Claude doesn't dump raw query results on you. It formats the answer in a way that's immediately useful. Here's what a conversion rate query might return:

Trial-to-Paid Conversion by Plan Tier (Last 3 Months)

Starter Plan:
  - December: 8.2% (41/500)
  - January:  9.1% (52/571)
  - February: 11.3% (68/602)
  Trend: Steadily climbing. Feb spike aligns with
  the new onboarding flow shipped Jan 28.

Growth Plan:
  - December: 14.7% (22/150)
  - January:  13.2% (19/144)
  - February: 15.8% (25/158)
  Trend: Stable with slight uptick in Feb.

Enterprise Plan:
  - December: 31.2% (5/16)
  - January:  27.8% (5/18)
  - February: 35.0% (7/20)
  Trend: Small sample sizes; interpret with caution.

Overall conversion improved from 9.8% to 12.4%
quarter-over-quarter. The Starter plan is driving
most of the improvement.

That's a complete analysis with context and trend interpretation. Not a spreadsheet you have to make sense of yourself.

Safety First: Read-Only Access

This is critical. Always use a read-only database connection. Never connect Claude Code to a database user that has write, update, or delete permissions. Here's why:

  • Claude generates SQL on the fly. A malformed query with write access could modify or delete data.
  • Read-only connections make it physically impossible for any query to change your data. The database rejects write operations at the connection level.
  • Most data teams can create a read-only user in 5 minutes. It's a standard practice.

Ask your DBA or DevOps team: "Can I get a read-only Postgres user that has SELECT access to our production tables?" They'll know exactly what you mean. If they push back on production access, ask for a read replica connection instead. Same data, zero risk to the primary database.

Setting Up BigQuery Instead

If your data lives in BigQuery, the setup is similar but uses a different MCP server:

{
  "mcpServers": {
    "bigquery": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-bigquery",
        "--project-id", "your-gcp-project-id",
        "--location", "US"
      ]
    }
  }
}

You'll need Google Cloud credentials configured on your machine (your data team can help). BigQuery is inherently safer since it's an analytics warehouse, but you should still use a service account with read-only permissions.

When You Still Need a Data Analyst

Claude Code handles 80% of the data questions PMs ask day-to-day. But some work still belongs with your data team:

  • Complex statistical analysis. Significance testing, cohort survival curves, multi-touch attribution models. Claude can run basic queries but shouldn't replace a trained analyst for statistical rigor.
  • Data quality investigations. If numbers look wrong, your data team knows the pipelines, ETL quirks, and edge cases. Don't trust a suspicious result without having an analyst verify.
  • Board-level reporting. Any numbers going to investors or the board should be validated by someone who understands the data model deeply.
  • New metric definitions. When you're defining what "activation" means for the first time, that's a cross-functional conversation, not a quick query.

The goal is to stop filing tickets for basic questions ("how many signups last month?") so your data team can focus on the hard problems that actually need their expertise.

Tips for Better Results

Be specific about time ranges. "Last month" works, but "February 1-28, 2026" is unambiguous. Claude handles both, but specific dates eliminate any confusion about date boundaries.

Name the metric you want. Instead of "how are we doing on growth?", ask "what's the week-over-week signup growth rate for the last 8 weeks?" Precision in, precision out.

Ask follow-up questions. Claude remembers context within a conversation. Start broad ("show me signups by month"), then narrow down ("break that down by acquisition channel"), then dig further ("which channel has the best trial-to-paid conversion?"). Each query builds on the last.

Ask Claude to show its SQL. If you want to learn or verify, say "show me the query you ran." Claude will display the exact SQL. Over time, you'll start recognizing patterns and building SQL intuition without formally studying it.

The Workflow That Changes Your Week

Here's what a Monday morning looks like after you set this up:

  1. Open Claude Code with your MCP server connected.
  2. Ask your weekly check-in questions. Signups, activation rate, churn, feature adoption. 5 minutes.
  3. Spot something interesting. "Why did activation drop last week?" Follow up immediately.
  4. Get answers in seconds. No ticket. No waiting. No scheduling a call with the data team.
  5. Walk into standup with real numbers instead of vibes.

You just reclaimed 2-3 days per week that used to disappear into the ticket queue. Your data team is happier because you're not clogging their backlog with basic pulls. Everyone wins.

Get Started

If you're new to Claude Code, start with the step-by-step tutorial. For a deeper understanding of MCP servers (including setup for other databases and services), read the MCP servers guide.

Want hands-on training? ClaudeFluent is our premium program where I teach PMs, product marketers, and operators how to build real workflows with Claude Code. Data pulls, release notes, competitive analysis, and dozens of other use cases. Join the next cohort and stop waiting on data tickets.

Related Guides

WANT MORE LIKE THIS?

Learn to build with Claude Code

6 hours of hands-on training. Build real projects. Ship without waiting on engineering.

View Class Details