databricks-dbsql

Generate Databricks SQL patterns for procedural workflows and complex analytics.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill databricks-dbsql-itsadijmbt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-dbsql
Source: https://github.com/itsadijmbt/SecureMCP-Servers/tree/main/TEST_SERVERS/PORTED_TO_SECUREMCP/databrickslab-mcp/ai-dev-kit/databricks-skills/databricks-dbsql
Command: npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill databricks-dbsql-itsadijmbt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps you write and optimize advanced Databricks SQL (DBSQL) queries for complex analytics, operational pipelines, and production-ready patterns instead of relying on basic SELECT/WHERE-only examples.

Core Features & Use Cases

  • SQL Scripting & Procedural Logic: Build compound statements with control flow, stored procedures, error handling, and multi-statement transactions to implement ETL/ELT logic directly in DBSQL.
  • Performance & BI Acceleration Patterns: Use materialized views, temporary tables/views, and pipe syntax to create faster, more maintainable query workflows.
  • Advanced Analytics Capabilities: Implement recursive CTEs for hierarchies, geospatial analytics with H3 and ST functions, collation-aware case-insensitive search, and in-SQL AI enrichment and federated queries (remote_query) and file ingestion (read_files).

Quick Start

Ask an AI to generate a Databricks SQL stored procedure that uses SQL scripting with a recursive CTE to upsert data and returns rows affected.

Frequently Asked Questions about databricks-dbsql

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

FAQPage Schema
How do I write a Databricks SQL stored procedure with control flow and error handling?

Databricks SQL scripting lets you build stored procedures with control flow, error handling, and multi-statement transactions. You can invoke these procedures using the CALL statement to implement ETL/ELT logic directly in DBSQL.

Can I use recursive CTEs for hierarchical data in Databricks SQL?

Recursive CTEs in Databricks SQL support hierarchical data traversal. You can use them to query parent-child relationships and organizational hierarchies within your lakehouse data.

Does Databricks SQL support geospatial analytics and H3 indexing?

Databricks SQL supports geospatial analytics using both H3 hexagonal indexing and ST functions. These allow you to perform spatial joins, distance calculations, and polygon containment queries directly in SQL.

What is the best way to accelerate BI queries in Databricks SQL?

Materialized views and temporary tables accelerate BI queries in Databricks SQL. Using these performance patterns alongside pipe syntax creates faster, more maintainable query workflows for your dashboards.

How do I use AI functions like ai_query and ai_classify in Databricks SQL?

Databricks SQL provides AI functions like ai_query, ai_classify, and ai_extract for in-SQL data enrichment. Apply LIMIT clauses for cost control and use serverless warehouses for recommended best performance.

Can I run federated queries and ingest external files using Databricks SQL?

Databricks SQL enables lakehouse federation through remote_query and external file ingestion via read_files. You can also use http_request to pull operational data directly into your SQL workflows.