Deepnote research: our notes on building agents
Get started

SQL notebook to query, explain, and share your data

Query your databases or CSV files, chart the results, and add Python when you need it, all in one shared workspace.

Deepnote keeps your queries, results and explanations together, so your team can follow the work from the first question to the final answer. Start with a supported data source and build an analysis others can review, reuse and extend.

SQL analysis your team can build on

A useful analysis includes the decisions behind the query: which records belong in the result, how a metric is defined, and what the team should investigate next.

Review the query and its context

Invite teammates into the project, leave comments beside the relevant work, and revisit earlier project versions. Keep questions about a join, filter or calculation close to the code they concern.

Give each audience the view they need

Share the project when reviewers need the underlying analysis. Publish a data app when stakeholders need a focused view of the results, with charts and input controls where useful.

Break complex questions into simple queries

SQL notebooks give you room to develop a question in stages. Inspect intermediate results, record what you checked, and keep useful queries ready for the next investigation.

Write and refine queries with schema context

Use schema-aware autocomplete to find relevant tables and columns as you write. When an analysis needs several steps, query chaining lets you reference earlier query previews in subsequent SQL blocks.

Break supported SELECT queries into manageable pieces, inspect the output, and explain where a filter or definition changes the interpretation.

Show weekly orders for the last three months, excluding test orders.
SnowflakeVariable:DataFrameweekly_orders
1SELECT DATE_TRUNC('week', created_at) AS week,
2 COUNT(*) AS orders
3FROM orders
4WHERE created_at >= DATEADD('month', -3, CURRENT_DATE)
5 AND is_test = FALSE
6GROUP BY 1 ORDER BY 1

Text to SQL: write SQL queries with AI

Describe the question in plain language—for example, “Show weekly orders for the last three months, excluding test orders.”

Deepnote Agent uses available schema and notebook context to help draft a query for your connected SQL dialect. Ask it to revise the query, explain unfamiliar logic or suggest a fix for an error.

Check the tables, joins, filters and assumptions before running the result. AI availability depends on your plan, workspace settings and connection.

Choose when to reuse or refresh results

For eligible connections, SQL query caching can return recent results instead of repeating a warehouse query. Set an expiration period, or run without cache when your analysis needs fresh data.

SnowflakeVariable:DataFramerevenue_by_region
Cache query resultsExpire after6 hours
1SELECT region, SUM(amount) AS revenue
2FROM orders
3GROUP BY region
Returned from cache · 2 min ago · 0.1 s

Combine SQL and Python in one notebook

Start with SQL to select, filter and aggregate your data, then use the query results in Python for statistical analysis, forecasting or custom visualizations. Deepnote keeps SQL and Python blocks in the same notebook, so you can move between querying and further analysis while keeping the code, results and explanations together.

G2 Leader in Analytics Platforms

Deepnote is recognized as a Leader and a Mid-Market High Performer in G2’s Analytics Platforms category.

G2 Leader badgeG2 Mid-Market High Performer badge
05/26/2025

Deepnote helped us turn raw data into real-time insights and smarter operations

“Deepnote makes pulling and exploring data so much easier. We can quickly connect to databases and get straight into analysis, which has really improved our visibility into performance and helped speed up decision-making. It’s also incredibly flexible — we’ve been able to build models that help ensure operational quality and adapt them as our needs evolve...”

Read the full Deepnote review
Jeffrey J.Credit Operations Manager
08/11/2025

Great notebook and automation tool that I’ve been using as a member of the data and analytics team

“Combining of SQL blocks and Python code is very seamless and easy to use. I believe the user experience overall was pretty good. It’s easy for me to get the hang of it after just an hour of using and exploration. As well as how easy it is to integrate different platforms such as Snowflake and OpenAI into my projects...”

Read the full Deepnote review
Dustin A.Data Analyst
06/24/2025

Powerful and versatile, good for both solo projects and client-facing work

“I’ve used Deepnote for everything from one-off dashboards for clients to big solo projects that involve stitching together data from multiple sources. It allows easy switching between Python and SQL in the same notebook (and maybe R? I haven’t tried that yet though!). It is also straightforward to integrate external data from Sheets or Snowflake...”

Read the full Deepnote review
Matthew T.Data Designer - Publishing

Connect PostgreSQL, Snowflake, BigQuery, and more

Bring data from supported databases and warehouses into your analysis. Configure the integration, attach it to your project, and select it in a SQL block.

Follow the setup guide for your source’s credentials, network access and plan requirements. Each connection has its own configuration; choose the one that matches where your data lives.

  • PostgreSQL: Query your PostgreSQL database from the notebook.

  • Snowflake: Explore warehouse data and build on the results.

  • BigQuery: Query your datasets and continue the analysis in Deepnote.

  • Microsoft SQL Server: Connect SQL Server, Azure SQL or Azure Synapse.

  • CSV files and DataFrames: Use DataFrame SQL to explore tabular files or pandas DataFrames without first connecting a warehouse.

See a SQL notebook example in action

Explore a cloud cost analysis, which starts with a SQL query and continues into a spend breakdown, a daily refresh, and a shared dashboard.

Cloud costsmonthly-spend
PostgreSQL
Integrations in this project
PostgreSQL
Snowflake
BigQuery — analytics

DataFrame SQL

Built with SQL in Deepnote

Explore examples of AI-assisted data analysis, sports analytics and churn modeling. Follow the queries, calculations and visualizations to see how an investigation comes together.

Customer churn ML playbook

Turn your SQL notebooks into an agent workspace

Deepnote Agent Workspace combines notebooks, data connections,
and business knowledge so agents can work with your data’s context.

Work from anywhere

Connect through Cursor, Claude Code, Codex, and other MCP-compatible tools. Access Deepnote notebooks and data within existing permissions.

Deploy always-on analytical agents

Schedule notebook workflows or trigger them through the API. Automate reports, data checks, and recurring analyses.

Build your context layer

Keep metric definitions, assumptions, analysis steps, and business context alongside your code. Turn trusted work into reusable skills, agents, and data apps.

Go deeper with SQL in Deepnote

Find the details for your next step:

SQL notebook FAQ






Turn your next query into a shared answer

Bring your data, run a query, and keep the result and the explanation in one place. Build an analysis that your team and agents can reuse.