SQL warehouses (serverless/pro/classic)

Databricks · Compute

Theory

A SQL warehouse is compute built for SQL: the SQL Editor, dashboards, Genie, alerts and BI tools such as Power BI or Tableau connect to it. You choose a T-shirt Cluster Size (2X-Small to 4X-Large), an Auto Stop idle time and Scaling (minimum and maximum clusters, so more clusters are added when many queries queue).

There are three main types. Serverless warehouses run in Databricks' account, start in seconds and add Intelligent Workload Management; they are the default and recommended type where available. Pro warehouses run in your cloud account with Photon and Predictive IO, and are used when serverless is not available or when you need custom networking. Classic warehouses also run in your account with Photon only and give entry-level performance. For example, the BI team's Power BI reports point at a Small serverless warehouse with Scaling 1 to 3 and Auto Stop of 10 minutes.

Why we use it

SQL users and BI tools need fast, concurrent, always-available SQL without managing Spark clusters. Warehouses give a JDBC/ODBC endpoint, scale for concurrency and stop themselves when idle.

When to use it

Use a SQL warehouse for SQL queries, dashboards and BI connections. Use notebooks on serverless or a cluster for Python, ML or complex ETL. Prefer serverless warehouses; pick pro only for networking needs or regions without serverless.

How it works

  1. Need SQL compute for analysts or BI
  2. SQL Warehouses → Create SQL warehouse
  3. Is serverless available and no custom networking needed? Yes: Type: Serverless. No: Type: Pro (or Classic).
  4. Pick Cluster Size, Auto Stop and Scaling
  5. Grant Can use to the analyst group
  6. Connect the SQL Editor or BI tool

Syntax

Sidebar → SQL Warehouses → Create SQL warehouse
Fields: Name, Cluster Size, Auto Stop, Scaling (min/max clusters), Type (Serverless | Pro | Classic)
Connection details tab: Server hostname, HTTP path

Example

-- Run in SQL Editor on the 'bi_wh' warehouse
SELECT c.city,
       COUNT(*)      AS orders,
       SUM(o.amount) AS revenue
FROM main.sales.orders o
JOIN main.sales.customers c USING (customer_id)
GROUP BY c.city
ORDER BY revenue DESC;

Key points

Databricks topics

Databricks Fundamentals

Compute

Notebooks & Development

Apache Spark on Databricks

Delta Lake

Unity Catalog & Governance

Data Ingestion

Declarative Pipelines (Lakeflow)

Lakeflow Jobs

Databricks SQL & BI

Architecture, Performance & Cost

Machine Learning & AI

Certification & Interview

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Master Databricks

The lakehouse platform from the ground up: Apache Spark, Delta Lake, Unity Catalog, Lakeflow pipelines and jobs, Databricks SQL and MLflow. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice SQL / Spark SQL Sharpen the SQL you use in Databricks SQL and Spark SQL: 150 query problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Databricks  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

{{ sec.h }}

{{ sec.body }}

{{ sec.body }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
Want to run this yourself? Databricks needs a real workspace — there's no in-browser engine for it. Click Copy above, then paste it into a notebook or the SQL editor in Databricks Free Edition (free, no credit card) and run it on serverless compute.
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic