SQL to ER Diagram
Home › BigQuery

BigQuery to ER Diagram

Turn a BigQuery query into a diagram. Paste a WITH … AS (…) CTE query and each CTE becomes a node, with edges inferred from the FROM / JOIN tables it reads — or paste plain CREATE TABLE DDL for a classic ER diagram.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Copy a BigQuery WITH / CTE query, or your CREATE TABLE DDL.
  2. Paste it into the editor — BigQuery CTE queries are auto-detected.
  3. Each CTE becomes a node; columns come from its SELECT list, and FROM/JOIN references (including backtick project.dataset.table) are drawn as edges.
  4. Arrange, hide nodes, then export PNG/SVG or convert to Mermaid/DBML.

Example

A BigQuery CTE query like this:

WITH customers AS (
  SELECT id, email FROM `proj.shop.customers_raw`
),
orders AS (
  SELECT o.id, o.customer_id
  FROM `proj.shop.orders_raw` o
)
SELECT * FROM orders

…renders customers and orders as nodes, linked to the base tables they read from. Try it with your own →

Guide

This page does something the others don't: it diagrams queries, not just schemas. Paste a BigQuery WITH … AS (…) statement and each CTE becomes a node on the canvas — its columns inferred from the SELECT list — with edges drawn to every table or CTE it reads from, including backtick-quoted project.dataset.table references. It's a dependency graph of your query, laid out and exportable.

For schema diagrams, grab real DDL from INFORMATION_SCHEMA:

SELECT ddl FROM `mydataset.INFORMATION_SCHEMA.TABLES` t
JOIN `mydataset.INFORMATION_SCHEMA.TABLES_DDL_QUERY` …

— or simply bq show --schema --format=prettyjson per table and paste the CREATE TABLE form. Standard types (STRING, INT64, NUMERIC, STRUCT, ARRAY<STRUCT<…>>) render on the nodes.

Note that BigQuery doesn't enforce foreign keys — so a pure DDL paste gives you tables without edges. That's honest: use Infer links to draw the _id conventions, or diagram the CTE query that joins them to see the real relationships in use.

Why use it

BigQueryCTE / WITHSnowflakeSQL

FAQ

How do I visualize a BigQuery CTE query?

Paste your WITH … AS (…) query. Each CTE becomes a node, columns come from its SELECT list, and references to other CTEs or backtick-quoted project.dataset.table tables are drawn as edges.

Does it work with BigQuery CREATE TABLE DDL too?

Yes — paste standard CREATE TABLE statements and it draws a classic ER diagram with foreign-key relations.

Is my schema uploaded anywhere?

No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.

Is it free?

Yes. It is completely free and open source, with no account or sign-up required.

Related