Ask sees your real schema, so its explanation of a query uses your actual table and column names, not generic placeholders.
No credit card. 14 days. Cancel in one click.
Quick answer: Select a query in the SQL Editor, click Ask (⌘L), attach Current query or Selection, and ask it to explain the query step by step. It answers in terms of your real tables and columns, with step cards showing what it looked at. Any provider's key works the same way.
A query you want explained, and your own API key added under Settings → AI Assistant. Ask works with Claude, GPT-6, Gemini or Grok, whichever provider's key you've added.
/verbose for full reasoning.A multi-join Databricks query that's less obvious at a glance than it looks:
SELECT o.order_id, c.customer_name, SUM(oi.quantity * oi.unit_price) AS order_total FROM sales.gold.orders o JOIN sales.gold.customers c ON o.customer_id = c.customer_id JOIN sales.gold.order_items oi ON oi.order_id = o.order_id WHERE o.order_date >= DATE_SUB(CURRENT_DATE(), 30) GROUP BY o.order_id, c.customer_name HAVING SUM(oi.quantity * oi.unit_price) > 500;
Attach it as Current query and ask for an explanation. Because Ask can see the connected schema, the answer breaks it down in terms of your actual tables: it joins orders to customers to get a name, joins to order_items to get the line-item quantities and prices, filters to orders from the last 30 days, groups by order, and keeps only orders whose total is above 500, that last part being the HAVING clause, which filters on an aggregate rather than a raw column the way WHERE does. Step cards under the answer show which tables and columns it actually looked at to write that explanation.
A generic AI chat product can explain SQL syntax fine, JOIN, GROUP BY, HAVING, in the abstract. What it can't do is tell you that c.customer_name in your specific schema comes from a table with three million rows and a non-unique index on customer_id, because it's never seen your schema. Ask has, because it's running against the same connection your query runs against.
Not every query needs the full walkthrough. For a short one:
SELECT region, COUNT(DISTINCT user_id) AS active_users FROM app.sessions WHERE session_start >= CURRENT_DATE - 7 GROUP BY region;
type /brief before your question for a one-line answer instead of a full breakdown: "counts distinct users per region who had a session in the last 7 days." If that's not enough, follow up in the same thread, "why DISTINCT and not just COUNT(*)," and it answers in context without you re-attaching the query.
This explains what a query does, it doesn't evaluate whether it's slow or suggest a faster version. For that, see asking why a query is slow instead, a related but separate question.
This works just as well on a query you inherited as one Ask wrote itself. Open an old script or a query a former teammate left behind, select it, attach it as Selection, and ask the same question. It reads the SQL exactly as written and explains what it actually does against your current schema, which sometimes surfaces something worth knowing on its own: a join to a column that's since been renamed, or a filter that no longer matches any rows.
A good explanation names your actual table and column names, not generic placeholders, and the step cards list the specific tables it read to answer.
Explaining a query before you run it against production is a cheap sanity check, especially for one you didn't write. It catches the case where a query does something subtly different from what its name suggests, a "monthly_active_users" view that's actually counting sessions, not distinct users, before that difference costs you an afternoon downstream.
| If you see | Fix |
|---|---|
| “Add an API key first” | Go to Settings → AI Assistant and add a key for the provider you want to use. |
| Explanation is vague or generic | Attach Current query or Selection explicitly rather than describing the query from memory in your question. |
| Explanation stops partway through | A long query can hit the 30-step budget. Click Continue to let it finish. |
No. Ask is bring-your-own-model, so Claude, GPT-6, Gemini or Grok all work the same way once you've added that provider's key in Settings. The example on this page uses Claude, but the steps are identical for any model.
Ask has schema context for whatever's connected: it can see your actual tables and columns through step cards, so its explanation refers to order_id and customer_name, not table.column placeholders.
Yes. Attach Current query or Selection to any query in the editor, yours or one you inherited, and ask for an explanation. It works the same as a query Ask wrote itself.
Ask works within a 30-step budget per question. A Continue button appears if it runs out of room before finishing; click it to keep going.
14-day free trial, no card. Attach your own key and ask.
No credit card. 14 days. Cancel in one click.