SQLise Studio · Examples

SQLise Examples

Real-world SQL examples with their column-level lineage rendered. Click any example, then SQLise it in the playground to explore.

BigQuery Backfill Script lineage diagram
bigquery
BigQuery Backfill Script
A BigQuery scripting block that loops over partitions and rebuilds a fact table. Lineage shows partition-by-partition flow into one mart.
dbt Incremental Events Model lineage diagram
snowflake
dbt Incremental Events Model
A compiled dbt incremental model that appends new events. Lineage shows the source events table feeding the incremental sink with a watermark filter.
dbt Staging Model Lineage lineage diagram
snowflake
dbt Staging Model Lineage
Compiled SQL from a typical dbt staging → intermediate → mart layering. Column lineage shows source freshness from source tables to mart columns.
Ecommerce Revenue Lineage lineage diagram
postgresql
Ecommerce Revenue Lineage
A typical ecommerce revenue model: orders join customers and order_items, then roll up into a daily revenue view. See how each output column traces back to its source tables.
LATERAL JOIN — Top-N per Group lineage diagram
postgresql
LATERAL JOIN — Top-N per Group
Get the top 3 most recent orders per customer using LATERAL. Lineage shows the lateral subquery as a stage between customers and the result.
Marketing Attribution Lineage lineage diagram
snowflake
Marketing Attribution Lineage
First-touch attribution joining sessions, conversions, and campaigns. The lineage shows which session columns become which attribution columns.
MERGE / UPSERT Pattern lineage diagram
snowflake
MERGE / UPSERT Pattern
A canonical MERGE that upserts staging rows into a dimension. Lineage exposes which target columns are sourced from which staging columns.
PIVOT Monthly Sales lineage diagram
sqlserver
PIVOT Monthly Sales
A long-format sales table pivoted into one column per month. Lineage shows every Jan..Dec column tracing to the same amount source.
Postgres JSONB Extraction lineage diagram
postgresql
Postgres JSONB Extraction
Project typed columns out of a JSONB payload and into a clean view. Lineage tracks every typed column back to the JSONB source.
Recursive CTE Org Chart lineage diagram
postgresql
Recursive CTE Org Chart
Walk a manager → employee hierarchy with WITH RECURSIVE. The lineage view treats the recursive CTE as a self-referencing stage.
Slowly Changing Dimension Type 2 lineage diagram
snowflake
Slowly Changing Dimension Type 2
Maintain a dim_customers SCD2 table from a staging snapshot. Lineage exposes both the active row and the closed-out historical row.
Snowflake Time Travel Audit lineage diagram
snowflake
Snowflake Time Travel Audit
Compare a Snowflake table to its state 24 hours ago using AT(OFFSET ⇒ -86400). Lineage shows the historical scan as a separate source.
Snowflake Transformation Pipeline lineage diagram
snowflake
Snowflake Transformation Pipeline
Snowflake stage → stream → task → warehouse table. See lineage across data-flow primitives, not just SELECTs.
SQL Server MERGE with OUTPUT lineage diagram
sqlserver
SQL Server MERGE with OUTPUT
A SQL Server MERGE that captures changed rows using the OUTPUT clause. Lineage covers both the target table and the audit table.
UNPIVOT Survey Responses lineage diagram
sqlserver
UNPIVOT Survey Responses
A wide survey table flattened into one row per (response_id, question). Lineage shows every wide column collapsing into one source column.
Window Function Running Total lineage diagram
postgresql
Window Function Running Total
A daily revenue table turned into a running total using SUM() OVER (ORDER BY day). Lineage shows the projected running_total column tracing back to revenue.