SQL Assistant
Built-in SQL functions that use AI to help you work with SQL. Generate SQL queries, execute read-only questions directly, fix errors, explain queries, and more.
These functions can be useful building blocks for AI-driven analytics solutions or used stand-alone on all MotherDuck surfaces (including the CLI).
To use external tools like Claude Desktop or Cursor with MotherDuck, see Connecting AI Tools to MotherDuck.
Available Functions
📄️ PROMPT_QUERY
Answer questions about your data
📄️ PROMPT_SQL
Overview
📄️ PROMPT_EXPLAIN
Explain a query
📄️ PROMPT_FIX_LINE
Fix your query line-by-line
📄️ PROMPT_FIXUP
Fix up your query
📄️ PROMPT_SCHEMA
Describe contents of a database