Writing and Running Queries in the SQL Editor

    Who this is for:

    Architecture / Concept Overview: Writing and Running Queries in the SQL Editor

    The SQL Editor sits at the intersection of the user, the SQL warehouse, and Unity Catalog. Every query you write flows through governance checks before execution.

    %%{init: {"theme":"base","themeVariables":{"background":"#0B0E14","primaryTextColor":"#E0E6ED","lineColor":"#5D6470","darkMode":true,"primaryColor":"#2E4A4A","secondaryColor":"#374151","secondaryTextColor":"#E0E6ED","tertiaryColor":"#111827","tertiaryTextColor":"#E0E6ED","edgeLabelBackground":"#1f2937"}}}%% flowchart LR classDef source fill:#3F4B59,stroke:#9CA3AF,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef ingestion fill:#5A4B36,stroke:#C9A86B,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef processing fill:#535072,stroke:#8E82B4,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef storage fill:#2E4A4A,stroke:#5FAFA8,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef serving fill:#3D5550,stroke:#6BB7AA,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef governance fill:#5A3F52,stroke:#C28BB0,stroke-width:2px,rx:8,ry:8,color:#E0E6ED USER[Analyst] -->|Writes SQL| EDITOR[SQL Editor] EDITOR -->|Sends statement| WH[SQL Warehouse] WH -->|Checks permissions| UC[Unity Catalog] UC -->|Returns metadata| WH WH -->|Reads files| DELTA[Delta Lake] WH -->|Returns results| EDITOR USER:::source EDITOR:::serving WH:::processing UC:::governance DELTA:::storage

    *Figure 1 — Query execution flow from the SQL Editor through the governance layer to Delta Lake storage.*

    The editor UI is composed of several panels that work together to streamline the analytics workflow.

    %%{init: {"theme":"base","themeVariables":{"background":"#0B0E14","primaryTextColor":"#E0E6ED","lineColor":"#5D6470","darkMode":true,"primaryColor":"#2E4A4A","secondaryColor":"#374151","secondaryTextColor":"#E0E6ED","tertiaryColor":"#111827","tertiaryTextColor":"#E0E6ED","edgeLabelBackground":"#1f2937"}}}%% graph TD classDef source fill:#3F4B59,stroke:#9CA3AF,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef ingestion fill:#5A4B36,stroke:#C9A86B,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef processing fill:#535072,stroke:#8E82B4,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef storage fill:#2E4A4A,stroke:#5FAFA8,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef serving fill:#3D5550,stroke:#6BB7AA,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef governance fill:#5A3F52,stroke:#C28BB0,stroke-width:2px,rx:8,ry:8,color:#E0E6ED EDITOR[SQL Editor Interface] --> SCHEMA[Schema Browser<br/>Catalogs · Schemas · Tables] EDITOR --> TABS[Query Tabs<br/>Multiple concurrent queries] EDITOR --> RESULTS[Results Panel<br/>Table · Chart · Download] EDITOR --> PARAMS[Parameters Bar<br/>Dynamic query inputs] EDITOR --> HISTORY[Query History<br/>Past executions & durations] EDITOR:::processing SCHEMA:::governance TABS:::serving RESULTS:::serving PARAMS:::ingestion HISTORY:::source

    *Figure 2 — SQL Editor interface components and their roles.*

    Key Terms

    Prerequisites and Setup

    • A running SQL warehouse (serverless recommended)
    • CAN USE privilege on the SQL warehouse
    • USE CATALOG and USE SCHEMA on the objects you plan to query
    • A modern browser (Chrome, Edge, or Firefox)

    Step-by-Step Implementation

      Configuration Reference

      Writing and Running Queries in the SQL Editor configuration options
      SettingScopeDefaultNotes
      Default catalogSessionmainOverride with USE CATALOG
      Default schemaSessiondefaultOverride with USE SCHEMA
      ANSI modeWarehousetrueStrict type checking per ANSI SQL
      Statement timeoutWarehouse48 hoursReduce for ad-hoc warehouses to prevent runaway queries
      Result row limit (UI)Editor10,000Use LIMIT in SQL for larger exports
      AutocompleteEditorEnabledProvides table, column, and function suggestions

      Monitoring, Cost, and Security Considerations

      Common Pitfalls and Recommended Patterns

        Frequently Asked Questions