---
title: "SQL Notebooks: Combining the power of Jupyter and SQL editors for data analytics"
description: "Meta's SQL Notebooks extends its Daiquery SQL editor with notebook-style named cells that reference each other as tables, compiling dependent cells into self-contained CTE queries run on distributed backends like Presto and Spark rather than on a local machine."
url: "https://swe.quest/articles/sql-notebooks-combining-the-power-of-jupyter-and-sql-editors-for-data-analytics-bf9e2bd8ffb65a89"
canonical: "https://engineering.fb.com/2022/04/26/developer-tools/sql-notebooks/"
source: "Meta Engineering"
published: "2022-04-26"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["sql","analytics","developer-tools","identity-auth"]
---

# SQL Notebooks: Combining the power of Jupyter and SQL editors for data analytics

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2022-04-26, 7 min read, Case study. Original: [https://engineering.fb.com/2022/04/26/developer-tools/sql-notebooks/](https://engineering.fb.com/2022/04/26/developer-tools/sql-notebooks/)

## Summary

Meta's SQL Notebooks extends its Daiquery SQL editor with notebook-style named cells that reference each other as tables, compiling dependent cells into self-contained CTE queries run on distributed backends like Presto and Spark rather than on a local machine. Sandboxed Python cells can post-process upstream SQL outputs as Pandas dataframes but cannot fetch data themselves. Because SQL can be statically checked against table and column ACLs, cached outputs are only shown to users who could have run the queries, so results can be shared safely and refreshed by scheduled jobs to avoid staleness. Jupyter-based notebooks (Bento) remain better for ML and service-API work, and the two tools are being merged.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)

## Prerequisites

- SQL common table expressions ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Jupyter notebooks

## Keywords

SQL Notebooks, Daiquery, Bento, Jupyter, Presto, Pandas, Plotly

## Related posts

- [Scheduling Jupyter Notebooks at Meta](https://swe.quest/articles/scheduling-jupyter-notebooks-at-meta-0caaff9caa37a0f3.md): Meta Engineering · 2023-08-29 · Medium · 5 min read · Data pipelines, Scheduling, Privacy, Python
  Meta schedules Bento (Jupyter) notebooks through a custom Dataswarm operator, BentoOperator, which keeps data lineage visible and privacy enforced even though notebook code is arbitrary.
- [Visualizing BlueSky data with Evidence.dev](https://swe.quest/articles/visualizing-bluesky-data-with-evidence-dev-2a64305ef654ddec.md): ClickHouse · 2025-01-15 · Medium · 6 min read · Analytics & OLAP, SQL
  Evidence.dev builds dashboards from SQL and markdown, running queries at build time rather than at request time.
- [Introducing the SQL Console on Datasets](https://swe.quest/articles/introducing-the-sql-console-on-datasets-89aa5e3e1204ae2f.md): Hugging Face · 2024-09-17 · Medium · 5 min read · SQL, Analytics & OLAP, WebAssembly, Model training
  Hugging Face Hub datasets now have a one-click SQL Console that runs DuckDB WASM entirely in the browser against each dataset's Parquet files, with views created per split and config.
- [How we made querying Pandas DataFrames with chDB 87x faster](https://swe.quest/articles/how-we-made-querying-pandas-dataframes-with-chdb-87x-faster-1ee5b7d8017e769d.md): ClickHouse · 2024-08-29 · Medium · 8 min read · Python, Performance engineering, Query engines, Analytics & OLAP, C & C++
  chDB, the in-process embedded ClickHouse, sped up SQL queries over Pandas DataFrames 87x by replacing its original Parquet serialize/deserialize round-trip through file descriptors with a native Python table engine that reads Python objects directly.
- [Institutional knowledge doesn't scale: Building an agentic data analyst](https://swe.quest/articles/institutional-knowledge-doesn-t-scale-building-an-agentic-data-analyst-d1fa65e5edaa8194.md): incident.io · 2026-08-03 · Medium · 10 min read · AI agents, Analytics & OLAP, LLMs, Observability, SQL
  incident.io built an internal "data brain" agent that answers business questions against BigQuery by encoding institutional analyst knowledge rather than relying on raw text-to-SQL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
