{
 "schema_version": 1,
 "generated": "2026-11-01",
 "id": "marimo-team-marimo--query-dataframes-with-sql-in-a-notebook",
 "repo": "marimo-team/marimo",
 "repo_url": "https://github.com/marimo-team/marimo",
 "repo_slug": "marimo-team-marimo",
 "title": "Query dataframes and databases with SQL in Python notebooks",
 "page_title": "How to query dataframes and databases with SQL in Python notebooks with Marimo",
 "summary": "Mix SQL cells that depend on Python values with Python cells, and page through results in interactive dataframes.",
 "who": "An analyst who thinks in SQL but needs Python for the rest of the analysis.",
 "problem": "Switching between a SQL client and a notebook breaks the flow and loses reproducibility.",
 "outcome": "A notebook where SQL results come back as Python dataframes and the whole thing is still a .py file.",
 "steps": [
  "Install the extras that unlock SQL cells with `pip install \"marimo[recommended]\"`",
  "Open a notebook with Marimo edit and add a SQL cell that references a Python variable",
  "Query dataframes, databases, CSVs or warehouses with the built-in SQL engine",
  "Page through, search, filter and sort the result in the interactive dataframe viewer",
  "Run pytest on the notebook if you want tests around the analysis"
 ],
 "agent_prompt": "Using marimo-team/marimo, create a notebook that loads <CSV or database>, adds a SQL cell filtered by a Python dropdown value, and shows the result in an interactive dataframe.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "This card is written from the marimo-team/marimo README, not from a test run by Deduped. Before you start, make sure you have Python and pip or conda. Check the repo for newer instructions before you rely on these steps.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "Python and pip or conda",
  "Optional: marimo[recommended] for SQL cells, AI completion and more",
  "Optional: your own API keys or a local model for AI features"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/marimo-team-marimo/query-dataframes-with-sql-in-a-notebook/",
 "md": "https://dedupedai.com/use-cases/marimo-team-marimo/query-dataframes-with-sql-in-a-notebook/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/marimo-team-marimo--query-dataframes-with-sql-in-a-notebook.json",
 "api_version": "v1"
}
