# MotherDuck Documentation - SQL Reference > Scoped MotherDuck documentation index for SQL Reference. Use this before the root index when the user's question is clearly about this area. - [Full scoped context](https://motherduck.com/docs/sql-reference/llms-full.txt): Complete Markdown content for SQL Reference. - [Root documentation index](https://motherduck.com/docs/llms.txt): All MotherDuck documentation sections. ## Pages - [AI Functions](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions): MotherDuck AI SQL functions for text generation, embeddings, and SQL assistance. - Sections: Available Functions - [Dives Functions](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives): SQL table functions for creating, reading, updating, and deleting MotherDuck Dives. - Sections: Available functions - [Flights functions](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights): SQL table functions for creating, scheduling, running, and inspecting MotherDuck Flights. - Sections: Available functions - [MCP Server](https://motherduck.com/docs/sql-reference/mcp): Connect AI assistants to MotherDuck using the remote (fully managed) or local (fully customizable) MCP server - Sections: Server capabilities, Local MCP server, Related resources - [MotherDuck REST API](https://motherduck.com/docs/sql-reference/rest-api/motherduck-rest-api): REST API reference for managing MotherDuck resources including databases, users, and access tokens. - [SQL Assistant](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant) - Sections: Available functions, Notes - [PROMPT_QUERY](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-query): Answer natural language questions about your data using the PROMPT_QUERY function. - Sections: Answer questions about your data - [PROMPT_SQL](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-sql): Generate SQL queries from natural language descriptions using the PROMPT_SQL function. - Sections: Overview, Syntax, Parameters, Examples, Failure example, Best practices... - [PROMPT_EXPLAIN](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-explain): Get AI-generated explanations of SQL queries using the PROMPT_EXPLAIN function. - Sections: Explain a query - [PROMPT_FIX_LINE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-fix-line): Fix SQL query errors line by line using the PROMPT_FIX_LINE function. - Sections: Fix your query line-by-line - [PROMPT_FIXUP](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-fixup): Automatically fix SQL query errors using the PROMPT_FIXUP function. - Sections: Fix up your query - [PROMPT_SCHEMA](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/sql-assistant/prompt-schema): Describe database contents using the PROMPT_SCHEMA function for AI-generated schema summaries. - Sections: Describe contents of a database - [ALTER DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-database): Update storage-related settings on a MotherDuck database. - Sections: Syntax, Options, Notes, Plan limits for native storage, Examples - [ALTER DATABASE SET SNAPSHOT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-database-snapshot): Restore a database from a snapshot using ALTER DATABASE SET SNAPSHOT TO. - Sections: Overview, Syntax, Options, Notes, Examples - [ALTER SNAPSHOT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-snapshot): Rename or remove names from database snapshots using ALTER SNAPSHOT. - Sections: Syntax, Considerations, Example usage - [ATTACH](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/attach): Attach local databases, MotherDuck databases, or public shares to your session - Sections: Attaching databases, Attaching shares, Examples, Troubleshooting - [COPY FROM DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/copy-database): Copy a database from one location to another in MotherDuck - Sections: Syntax, Example Usage - [COPY FROM DATABASE (OVERWRITE)](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/copy-database-overwrite): Overwrite a database with a zero-copy clone from another database. - Sections: Syntax - [CREATE DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-database): Create a database, zero-copy clone from an existing database, or import a local DuckDB file into MotherDuck. - Sections: Syntax, Database options, Source database options, Example usage - [CREATE SECRET](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-secret): Create a secret in MotherDuck - Sections: Syntax, Secret parameters, Examples, Querying with secrets, Discovering buckets and files, Troubleshooting - [CREATE SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-share): Create a share from a database to share data with other users - Sections: Syntax, Example usage - [CREATE SNAPSHOT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-snapshot): Create a snapshot of a MotherDuck database for recovery or read scaling. - Sections: Syntax, Notes, Read scaling, Examples - [DATABASE_SNAPSHOTS view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/database_snapshots): Query the DATABASE_SNAPSHOTS view for snapshot history and data recovery options. - Sections: Schema, Example usage, Understanding timestamps, Troubleshooting, See also - [DATABASES view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/databases): Query the DATABASES view to list all databases you have created in MotherDuck. - Sections: Schema, Example usage - [DESCRIBE SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/describe-share): Get details about a specific share by name or URL. - [DETACH](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/detach): Detach local, remote, or shared databases from your session - Sections: Detaching Databases, Detaching Shares - [DROP DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/drop-database): Remove a database from MotherDuck. - [DROP SECRET](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/delete-secret): Delete a secret from MotherDuck or local storage. - [DROP SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/drop-share): Delete a share and revoke access for all attached users. - [EMBEDDING](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/embedding): Generate vector embeddings for text using the EMBEDDING function for semantic search. - Sections: Embedding function - [EXPLAIN](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/explain): Display the physical query plan without executing the query. - Sections: Syntax, Example Usage - [EXPLAIN ANALYZE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/explain-analyze): Execute a query and display performance metrics for each operator. - Sections: Syntax, Example Usage - [GRANT READ ON SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/grant-access): Give users access to a restricted share. - Sections: Syntax, Example usage, Complete workflow example - [LIST SECRETS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/list-secrets): List all secrets stored in memory and MotherDuck. - [LIST SHARES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/list-shares): List all shares created by the current user. - Sections: Syntax, Output - [list_databases](https://motherduck.com/docs/sql-reference/mcp/list-databases): List all databases in your MotherDuck account - Sections: Description, Input Parameters, Output Schema, Example Usage, Success Response Example - [MD_ACTIVE_SERVER_CONNECTIONS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/monitor-connections): View active connections and running queries in MotherDuck using md_active_connections. - Sections: Syntax - [MD_CREATE_FLIGHT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-create-flight): Create a new Flight in your MotherDuck account. - Sections: Syntax, Parameters, Return columns, Examples, Related - [MD_LIST_DIVES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-list-dives): List all Dives in your MotherDuck account with pagination support. - Sections: Syntax, Parameters, Return columns, Examples, Related - [MD_RUN parameter](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-run-parameter): Control whether table functions run locally or remotely. - [PRINT_MD_TOKEN pragma](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/print-md-token): Retrieve your MotherDuck authentication token. - [PROMPT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/prompt): Generate AI responses directly in SQL with the PROMPT function. - Sections: Prompt function, Syntax, Example usage, Use cases, Batch processing, Error handling... - [QUERY_HISTORY view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/query_history): Access detailed query history and metrics using the QUERY_HISTORY view (Business plan). - Sections: Schema, Example usage - [RECENT_QUERIES view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/recent_queries): View recent query activity across your organization using the RECENT_QUERIES view (Business plan). - Sections: Schema, Example usage, Limitations - [REFRESH DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/refresh-database): Sync databases with the latest snapshot or share updates. - Sections: Behavior by connection mode, Syntax, Syntax, Examples, Related Content - [REVOKE READ ON SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/revoke-access): Remove user access from a restricted share. - Sections: Syntax, Example usage - [SHOW ALL DATABASES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/show-databases): List all MotherDuck, DuckDB, and shared databases. - [SHUTDOWN](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/shutdown-terminate): Gracefully shut down or force-terminate your Duckling to manage compute costs and recover from stuck queries. - Sections: SHUTDOWN, SHUTDOWN TERMINATE, Choosing between SHUTDOWN and SHUTDOWN TERMINATE - [STORAGE_INFO views](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/storage_info): View storage footprint, billing, and lifecycle information for all databases in your MotherDuck organization - Sections: Overview, Syntax, Columns, Examples, Notes, Troubleshooting - [TEMPORARY TABLES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/temporary-tables): Create local temporary tables for session-scoped data. - Sections: Syntax, Example Usage, Notes - [UNDROP DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/undrop-database): Restore a dropped MotherDuck database within its snapshot retention window. - Sections: Syntax, Notes, Examples - [UPDATE SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/update-share): Manually update a share with a new database snapshot. - [useSQLQuery hook](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/use-sql-query): React hook for querying MotherDuck data from within Dives. - Sections: Import, Syntax, Parameters, Return value, Numeric values, Examples... - [useDiveState hook](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/use-dive-state): React hook for storing shareable UI state in MotherDuck Dives. - Sections: Import, Syntax, Parameters, Return value, Reset state, Examples... - [list_shares](https://motherduck.com/docs/sql-reference/mcp/list-shares): List database shares that have been shared with you - Sections: Description, Input Parameters, Output Schema, Example Usage, Success Response Example, Empty Response Example... - [MD_GET_DIVE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-get-dive): Retrieve a Dive by ID including its full React component content. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [MD_INTERRUPT_SERVER_CONNECTION](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/interrupt-connections): Cancel running queries and terminate active connections to MotherDuck using SQL commands. - Sections: Syntax, Return value, Example usage - [MD_UPDATE_FLIGHT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-update-flight): Update a Flight's source code, requirements, config, token, secrets, name, or schedule. - Sections: Syntax, Parameters, Return columns, Behavior, Examples, Related - [OWNED_SHARES view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/owned_shares): Query the OWNED_SHARES view to see database shares you have created. - Sections: Schema, Example usage - [Query syntax](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/query-syntax): DuckDB query syntax including SELECT, FROM, WHERE, GROUP BY, ORDER BY, and other clauses. - [Data types](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/data-types): Supported data types in DuckDB including numeric, string, date/time, and complex types. - Sections: VARIANT type - [Enum data type](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/enum): DuckDB enum data type for defining columns with a fixed set of string values. - [Expressions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/expressions): DuckDB expression syntax including operators, CASE, subqueries, and type casts. - [list_tables](https://motherduck.com/docs/sql-reference/mcp/list-tables): List tables and views in a MotherDuck database - Sections: Description, Input Parameters, Output Schema, Example Usage, Success Response Example, Error Response Example - [MD_CREATE_DIVE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-create-dive): Create a new Dive in your MotherDuck account. - Sections: Syntax, Parameters, Return columns, Examples, Related - [MD_CURRENT_CLIENT_CONNECTION_ID and MD_CURRENT_CLIENT_DUCKDB_ID](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/connection-duckdb-id): Retrieve connection identifiers and DuckDB instance IDs for debugging and monitoring. - Sections: Syntax, Example usage - [MD_DELETE_FLIGHT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-delete-flight): Delete a Flight, its versions, runs, and logs. - Sections: Syntax, Parameters, Examples, Related - [SHARED_WITH_ME view](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/shared_with_me): Query the SHARED_WITH_ME view to see database shares available to you. - Sections: Schema, Example usage - [list_columns](https://motherduck.com/docs/sql-reference/mcp/list-columns): List columns of a table or view with types and comments - Sections: Description, Input Parameters, Output Schema, Example Usage, Success Response Example, Error Response Example - [MD_GET_FLIGHT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-get-flight): Fetch the summary metadata for a single Flight. - Sections: Syntax, Parameters, Return columns, Examples, Related - [MD_LAST_QUERY_ID](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/last-query-id): Use MD_LAST_QUERY_ID() to get the UUID of the most recent query sent to MotherDuck. - Sections: Syntax, Return type, Example usage - [MD_UPDATE_DIVE_METADATA](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-update-dive-metadata): Update a Dive's title or description without creating a new version. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [Functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/functions): Built-in scalar functions in DuckDB for string manipulation, math, dates, and more. - [MD_GET_FLIGHT_VERSION](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-get-flight-version): Fetch the full content (source, requirements, config, token, secrets) for a specific Flight version. - Sections: Syntax, Parameters, Return columns, Behavior, Examples, Related - [MD_UPDATE_DIVE_CONTENT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-update-dive-content): Update a Dive's React component code, creating a new version. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [PRAGMA database_size](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/database_size): Get storage size information for MotherDuck databases using PRAGMA database_size. - Sections: Alternative invocations, Schema, Example Usage - [search_catalog](https://motherduck.com/docs/sql-reference/mcp/search-catalog): Fuzzy search across databases, schemas, tables, columns, and shares - Sections: Description, Input Parameters, Output Schema, Result Limits, Example Usage, Success Response Example... - [Wasm Client](https://motherduck.com/docs/sql-reference/wasm-client): Connect browser applications to MotherDuck using the DuckDB WebAssembly client and Hybrid Query Execution. - Sections: Examples, DuckDB version support, Installation, Dependencies, Usage - [Aggregate functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/aggregate-functions): DuckDB aggregate functions like SUM, COUNT, AVG, and statistical functions. - [MD_DELETE_DIVE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-delete-dive): Permanently delete a Dive by ID. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [MD_FLIGHTS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-flights): List the Flights you own with summary metadata. - Sections: Syntax, Parameters, Return columns, Examples, Related - [Postgres Endpoint](https://motherduck.com/docs/sql-reference/postgres-endpoint): Connection parameters, SSL options, session settings, and limitations for the MotherDuck Postgres wire protocol endpoint - Sections: Connection parameters, Connection string formats, SSL and certificate verification, Session options, Supported features and limitations - [query](https://motherduck.com/docs/sql-reference/mcp/query): Execute SQL queries against MotherDuck databases - Sections: Description, Input Parameters, Output Schema, Limits, Example Usage, Success Response Example... - [query_rw](https://motherduck.com/docs/sql-reference/mcp/query-rw): Execute SQL queries that can modify data or schema in MotherDuck - Sections: Description, Input parameters, Output schema, Limits, Example usage - [ask_docs_question](https://motherduck.com/docs/sql-reference/mcp/ask-docs-question): Ask questions about DuckDB or MotherDuck documentation - Sections: Description, Input Parameters, Output Schema, Example Usage, Success Response Example, Tips for Good Questions - [MD_FLIGHT_VERSIONS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-flight-versions): List the version history of a Flight. - Sections: Syntax, Parameters, Return columns, Examples, Related - [MD_LIST_DIVE_VERSIONS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-list-dive-versions): List all versions of a specific Dive with pagination support. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [Window functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/window-functions): DuckDB window functions for ranking, running totals, and analytical queries. - [Configurations](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/configurations): DuckDB configuration options for memory, threads, and query behavior. - [get_dive_guide](https://motherduck.com/docs/sql-reference/mcp/get-dive-guide): Load instructions for creating MotherDuck Dives - Sections: Description, Input parameters, Output schema, Example usage - [MD_GET_DIVE_VERSION](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/dives/md-get-dive-version): Retrieve a specific historical version of a Dive including its content. - Sections: Syntax, Parameters, Return columns, Examples, Errors, Related - [MD_RUN_FLIGHT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-run-flight): Trigger an on-demand execution of a Flight using its current version. - Sections: Syntax, Parameters, Return columns, Behavior, Examples, Related - [Constraints](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/constraints): Table constraints in DuckDB including PRIMARY KEY, UNIQUE, NOT NULL, and CHECK. - [list_dives](https://motherduck.com/docs/sql-reference/mcp/list-dives): List all Dives in your MotherDuck workspace - Sections: Description, Input parameters, Output schema, Example usage, Success response example - [MD_FLIGHT_RUNS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-flight-runs): List the execution history of a Flight, newest first. - Sections: Syntax, Parameters, Return columns, Examples, Related - [Information schema](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/information-schema): DuckDB information_schema views for querying database metadata. - [MD_FLIGHT_LOGS](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-flight-logs): Read the combined stdout and stderr captured during a Flight run. - Sections: Syntax, Parameters, Return columns, Behavior, Examples, Related - [read_dive](https://motherduck.com/docs/sql-reference/mcp/read-dive): Read a specific Dive by ID, including its full component code - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Error response example - [view_dive](https://motherduck.com/docs/sql-reference/mcp/view-dive): Render a MotherDuck Dive as a live, interactive MCP app inside the host client. - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Error response example... - [MD_CANCEL_FLIGHT_RUN](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/md-cancel-flight-run): Cancel an in-progress Flight run. - Sections: Syntax, Parameters, Examples, Related - [Metadata functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/metadata-functions): DuckDB functions for querying table and column metadata programmatically. - [save_dive](https://motherduck.com/docs/sql-reference/mcp/save-dive): Save a new Dive to your MotherDuck workspace - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Validation error response example - [PRAGMA statements](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/pragma-statements): PRAGMA statements for DuckDB configuration and metadata queries. - [update_dive](https://motherduck.com/docs/sql-reference/mcp/update-dive): Update an existing Dive's title, description, or content - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Error response example - [SAMPLE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/sample): SAMPLE clause for retrieving random subsets of query results in DuckDB. - [share_dive_data](https://motherduck.com/docs/sql-reference/mcp/share-dive-data): Share the data for a Dive with your organization - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Nothing to share response example... - [delete_dive](https://motherduck.com/docs/sql-reference/mcp/delete-dive): Permanently delete a Dive by ID - Sections: Description, Input parameters, Output schema, Example usage, Success response example, Error response example - [get_flight_guide](https://motherduck.com/docs/sql-reference/mcp/get-flight-guide): Load the canonical instructions for authoring, scheduling, running, and troubleshooting MotherDuck Flights. - Sections: Description, Input parameters, Output schema, Example usage, Related - [list_flights](https://motherduck.com/docs/sql-reference/mcp/list-flights): List the Flights you own with summary metadata, optionally filtered by keywords. - Sections: Description, Input parameters, Output schema, Example usage, Related - [get_flight](https://motherduck.com/docs/sql-reference/mcp/get-flight): Fetch a Flight's metadata and version snapshot by UUID, optionally at a specific historical version. - Sections: Description, Input parameters, Output schema, Example usage, Related - [list_flight_versions](https://motherduck.com/docs/sql-reference/mcp/list-flight-versions): List the version history of a Flight, newest first. - Sections: Description, Input parameters, Output schema, Example usage, Related - [create_flight](https://motherduck.com/docs/sql-reference/mcp/create-flight): Create a new Flight from Python source code, requirements, token, and an optional schedule. - Sections: Description, Input parameters, Output schema, Example usage, Related - [update_flight](https://motherduck.com/docs/sql-reference/mcp/update-flight): Update a Flight's source, requirements, config, token, secrets, name, or schedule. - Sections: Description, Input parameters, Output schema, Example usage, Related - [edit_flight_source](https://motherduck.com/docs/sql-reference/mcp/edit-flight-source): Edit a Flight's source code with one or more find-and-replace operations, producing a new version. - Sections: Description, Input parameters, Output schema, Example usage, Related - [delete_flight](https://motherduck.com/docs/sql-reference/mcp/delete-flight): Permanently delete a Flight, its versions, schedule, and run history. - Sections: Input parameters, Output schema, Example usage, Related - [run_flight](https://motherduck.com/docs/sql-reference/mcp/run-flight): Trigger an on-demand execution of a Flight using its current version. - Sections: Description, Input parameters, Output schema, Example usage, Related - [list_flight_runs](https://motherduck.com/docs/sql-reference/mcp/list-flight-runs): List the execution history of a Flight, newest first. - Sections: Input parameters, Output schema, Example usage, Related - [get_flight_run_logs](https://motherduck.com/docs/sql-reference/mcp/get-flight-run-logs): Fetch the logs and run record for a single Flight run. - Sections: Description, Input parameters, Output schema, Example usage, Related - [cancel_flight_run](https://motherduck.com/docs/sql-reference/mcp/cancel-flight-run): Cancel an in-progress Flight run. - Sections: Input parameters, Output schema, Example usage, Related - [ALTER TABLE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/alter-table): ALTER TABLE statement for modifying table structure in DuckDB. - [ATTACH/DETACH](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/attach-detach): ATTACH and DETACH statements for connecting to external databases in DuckDB. - [CALL](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/call): CALL statement for executing table functions in DuckDB. - [COMMENT ON](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/comment-on): COMMENT ON statement for adding descriptions to database objects in DuckDB. - [COPY](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/copy): COPY statement for importing and exporting data in DuckDB. - [Create a Dive embed session](https://motherduck.com/docs/sql-reference/rest-api/dashboards-create-embed-session): Creates an embed session for the specified Dive. - Sections: Request - [Create an access token for a user](https://motherduck.com/docs/sql-reference/rest-api/users-create-token): Create an access token for a user - Sections: Request - [CREATE INDEX](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-index): Use CREATE INDEX to speed up point lookups and highly selective queries in MotherDuck. - Sections: Syntax, When to use indexes, Example, Constraints, Trade-offs - [CREATE MACRO](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-macro): CREATE MACRO statement for defining reusable SQL expressions in DuckDB. - [Create new user](https://motherduck.com/docs/sql-reference/rest-api/users-create-service-account): Create user is restricted to creating a user with a 'Member' role - Sections: Request - [CREATE TABLE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-table): CREATE TABLE statement for defining new tables in DuckDB. - [DELETE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/delete): DELETE statement for removing rows from DuckDB tables. - [Delete a user](https://motherduck.com/docs/sql-reference/rest-api/users-delete): Permanently delete a user and all of their data. THIS CANNOT BE UNDONE - Sections: Request - [DROP](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/drop): DROP statement for removing tables, views, and other objects in DuckDB. - [DuckDB SQL](https://motherduck.com/docs/sql-reference/duckdb-sql-reference): DuckDB SQL Reference - [DuckDB statements](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements): DuckDB SQL statements reference - [EXPORT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/export): EXPORT statement for exporting database contents to files in DuckDB. - [Get active accounts](https://motherduck.com/docs/sql-reference/rest-api/ducklings-get-active-accounts): [Preview] Get active accounts in an organization along with active Ducklings per account. Requires 'Admin' role - [Get user Duckling configuration](https://motherduck.com/docs/sql-reference/rest-api/ducklings-get-duckling-config-for-user): Gets Duckling (instance) configuration for a user. Requires 'Admin' role. - Sections: Request - [INSERT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/insert): INSERT statement for adding rows to tables in DuckDB. - [Introduction to MD_INFORMATION_SCHEMA](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/introduction): Introduction to MD_INFORMATION_SCHEMA - Sections: Example usage - [Invalidate a user access token](https://motherduck.com/docs/sql-reference/rest-api/users-delete-token): Invalidate a user access token - Sections: Request - [List a user's access tokens](https://motherduck.com/docs/sql-reference/rest-api/users-list-tokens): List a user's access tokens - Sections: Request - [MD_ATTACHED_DATABASES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-attached-databases): List databases attached to your DuckDB and MotherDuck session. - Sections: Syntax, Output, Example usage - [MD_LIST_BUCKETS_FOR_SECRET](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-list-buckets-for-secret): List S3 buckets visible to a named MotherDuck secret. - Sections: Syntax, Output, Example usage - [MD_LIST_FILES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-list-files): List files and folders in S3 and Azure storage from SQL. - Sections: Syntax, Output, Example usage, Notes - [MD_LIVE_DUCKLING_SIZE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-live-duckling-size): Return the current Duckling instance type for the active MotherDuck connection. - Sections: Syntax, Output, Example usage - [MD_USER](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-user): Return the current MotherDuck user name. - Sections: Syntax, Output, Example usage - [MD_VERSION](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-version): Inspect the loaded MotherDuck extension version and build hash. - Sections: Syntax, Output, Example usage - [MotherDuck SQL](https://motherduck.com/docs/sql-reference/motherduck-sql-reference): MotherDuck-specific SQL extensions and cloud database management - [PIVOT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/pivot): PIVOT statement for transforming rows to columns in DuckDB. - [RESULT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/result): Run a SELECT asynchronously and query its cached results like a table. - Sections: Syntax, Output, Example usage, Notes - [SELECT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/select): SELECT statement syntax and options in DuckDB. - [Set user Duckling configuration](https://motherduck.com/docs/sql-reference/rest-api/ducklings-set-duckling-config-for-user): Sets Duckling (instance) configuration for a user. Requires 'Admin' role - Sections: Request - [SET/RESET](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/set-reset): SET and RESET statements for configuring DuckDB session options. - [SQL reference](https://motherduck.com/docs/sql-reference): SQL reference for MotherDuck & DuckDB - [UNPIVOT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/unpivot): UNPIVOT statement for transforming columns to rows in DuckDB. - [UPDATE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/update): UPDATE statement for modifying existing rows in DuckDB tables. - [USE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/use): USE statement for changing the default database or schema in DuckDB. - [VACUUM](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/vacuum): VACUUM statement for optimizing storage in DuckDB.