databricks-dbsql

Enable procedural SQL, stored procedures, and recursive CTEs in Databricks SQL.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/Blackkadder/databricks-apps-and-agents-workshop --skill databricks-dbsql-blackkadder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-dbsql
Source: https://github.com/Blackkadder/databricks-apps-and-agents-workshop/tree/main/.claude/skills/databricks-dbsql
Command: npx skills add https://github.com/Blackkadder/databricks-apps-and-agents-workshop --skill databricks-dbsql-blackkadder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Databricks SQL (DBSQL) advanced features provide a unified, governance-aware toolkit to build, optimize, and govern complex analytics and data pipelines directly in the Databricks Lakehouse. It helps teams leverage procedural SQL, stored procedures, recursive CTEs, materialized views, and AI-enabled SQL patterns to accelerate data workflows.

Core Features & Use Cases

  • Procedural SQL scripting (BEGIN...END, DECLARE, LOOP, TRY/CATCH) for ETL and orchestration
  • Stored procedures and recursive CTEs for modular, reusable data pipelines and hierarchical queries
  • Materialized views, pipe syntax, and liquid clustering guidance for fast BI dashboards and scalable analytics
  • AI functions, HTTP requests, and Lakehouse federation (remote_query) for data enrichment and cross-database analytics
  • Reference patterns and best practices to optimize data models, performance, and governance

Quick Start

Explore the DBSQL features in your Databricks workspace by running a basic procedural script that uses BEGIN...END, a stored procedure, and a simple remote_query.

Frequently Asked Questions about databricks-dbsql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write procedural SQL scripts for ETL orchestration in Databricks?

Procedural SQL scripting in Databricks uses BEGIN...END, DECLARE, LOOP, and TRY/CATCH blocks to build modular ETL pipelines and orchestrate data workflows directly within the Lakehouse.

Can I query external databases from Databricks SQL using Lakehouse Federation?

Lakehouse Federation uses the remote_query function in Databricks SQL to execute cross-database analytics, enabling direct data enrichment and queries across remote databases without moving data.

What is the best way to handle hierarchical data queries in Databricks SQL?

Recursive CTEs in Databricks SQL provide the standard mechanism for querying hierarchical data structures, allowing you to traverse parent-child relationships within your data pipelines.

Do I need a Unity Catalog-enabled workspace to use Databricks SQL stored procedures?

Yes, deploying stored procedures and leveraging advanced Databricks SQL features requires a serverless deployment within a Unity Catalog-enabled workspace to ensure proper governance.

How do AI functions enhance SQL queries in Databricks?

AI functions in Databricks SQL enable advanced data enrichment by allowing you to integrate artificial intelligence capabilities and HTTP requests directly into your SQL queries.

Are there limitations when using materialized views for BI dashboards in Databricks?

Materialized views optimize BI dashboards by pre-computing results, but best practices recommend combining them with liquid clustering and pipe syntax for scalable analytics and performance.