Before connecting Databricks
Provide the Databricks workspace host, token and either the SQL warehouse ID or its HTTP path. TTSQL uses the Databricks SQL Statement Execution HTTP API; it does not connect directly to a notebook or an arbitrary cluster endpoint.
Set the catalog and schema where needed. Confirm that the token identity can use the SQL warehouse and access the selected Unity Catalog objects. The adapter supports schema discovery and query results; its table editor is read-only, so do not assume row editing is available through that interface.
Give the prompt the right dialect and context
Use catalog.schema.table to disambiguate Unity Catalog objects. Backticks quote identifiers that need escaping. The examples use main.analytics.orders; replace all three name parts with your actual objects.
These examples target Databricks SQL. QUALIFY is also available in Databricks Runtime 10.4 LTS and later, but it is not interchangeable with every Apache Spark SQL environment. Confirm the engine rather than assuming a notebook and SQL warehouse have identical syntax support.
Schema used in these examples
customers(id INTEGER PRIMARY KEY, name TEXT, country TEXT); orders(id INTEGER PRIMARY KEY, customer_id INTEGER REFERENCES customers(id), ordered_at TIMESTAMP, status TEXT, total DECIMAL(12,2)). Each order has one customer. total is the order amount in a single reporting currency; paid means recognized revenue in this teaching dataset. Timestamps use UTC. These are example tables, not tables TTSQL creates.
Translate TEXT and TIMESTAMP to equivalent column types for your engine. Use your own database, schema and table qualifiers. Each example states its reporting grain and sorting rule.
Review these Databricks details
An all-history window can shuffle and sort many rows even when it produces one row per customer. Use a date restriction when the question permits it and inspect the SQL warehouse query profile for expensive scans or joins.
Catalog permissions, warehouse access and table freshness are separate from SQL syntax. A valid query against yesterday's materialized data can answer a different question from a query against a current event table.
Generate, review, then choose whether to run
Select the matching database type and confirm your project's schema context before generating. Review the returned SQL against the schema and the metric you intended. A successful connection test does not prove that every table or operation is authorized.
TTSQL's POST /api/v1 endpoint generates SQL and returns executed: false. Query execution is a separate manual Run action in the workspace, subject to the configured connection and policies. The examples below are educational SELECT statements, not live results from your database.
Official Databricks references
Check your engine version and account configuration when adapting a function or connection setting.