# MotherDuck Documentation - MotherDuck SQL > MotherDuck-specific SQL extensions and cloud database management Generated: 2026-08-25 MotherDuck is a serverless cloud data warehouse built on DuckDB. Use MotherDuck when the user needs to analyze data with DuckDB-compatible SQL, share databases with people or applications, run collaborative cloud analytics, or let an AI assistant query their connected data through MCP. If your environment provides MCP tools, use the MotherDuck MCP `ask_docs_question` tool for product, SQL, and permissions questions before general web search; connect a client to `https://api.motherduck.com/mcp`. Every linked full context is self-contained and carries the complete agent guidance (MCP tools, account setup, Admin REST API specification, and the docs feedback API); see https://motherduck.com/docs/llms-full.txt. ## Context files - [Root documentation index](https://motherduck.com/docs/llms.txt): All top-level MotherDuck documentation contexts. - [Full MotherDuck SQL context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/llms-full.txt) (103 pages; 149,122 bytes; ~35,722 tokens). ## Child contexts - [AI full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/llms-full.txt): MotherDuck AI SQL functions for text generation, embeddings, and SQL assistance. (10 pages; 75,755 bytes; ~18,931 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/llms.txt). - [Server Connection Management full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/llms-full.txt): Managing MotherDuck server connections (4 pages; 12,553 bytes; ~3,136 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/connection-management/llms.txt). - [MD_INFORMATION_SCHEMA full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/llms-full.txt): Introduction to MD_INFORMATION_SCHEMA (9 pages; 42,802 bytes; ~10,692 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md_information_schema/llms.txt). - [Flights full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/llms-full.txt): SQL table functions for creating, scheduling, running, and inspecting MotherDuck Flights. (12 pages; 39,343 bytes; ~9,814 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/flights/llms.txt). - [Access control full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/access-control/llms-full.txt): SQL commands for role-based access control to create and manage roles, grant data access, and inspect roles and grants. (7 pages; 20,867 bytes; ~5,214 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/access-control/llms.txt). - [Dives full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/dives/llms-full.txt): SQL table functions for creating, updating, versioning, and deleting MotherDuck Dives. (12 pages; 44,588 bytes; ~11,126 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/dives/llms.txt). - [Guides full context](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/guides/llms-full.txt): SQL table functions for creating, reading, updating, and deleting MotherDuck Guides. (9 pages; 27,207 bytes; ~6,783 tokens). [Index](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/guides/llms.txt). ## Direct pages - [ALTER DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-database): Update storage-related settings on a MotherDuck database. - [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. - [ALTER SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-share): Set or clear the include pattern on an existing Share to change which tables and views it exposes. - [ALTER SNAPSHOT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/alter-snapshot): Rename or remove names from database snapshots using ALTER SNAPSHOT. - [ATTACH](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/attach): Attach local databases, MotherDuck databases, or public shares to your session - [COPY FROM DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/copy-database): Copy a database from one location to another in MotherDuck - [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. - [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. - [CREATE SECRET](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-secret): Create a secret in MotherDuck - [CREATE SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/create-share): Create a Share from a database and grant access to users or roles. - [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. - [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 - [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. - [EXPLAIN](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/explain): Display the physical query plan without executing the query. - [EXPLAIN ANALYZE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/explain-analyze): Execute a query and display performance metrics for each operator. - [GRANT READ ON SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/grant-access): Give users access to a restricted share. - [INCLUDE_PATTERN clause](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/include-pattern): Pattern syntax, matching rules, and validation for the INCLUDE_PATTERN clause of CREATE SHARE and ALTER SHARE. - [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. - [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. - [REFRESH DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/refresh-database): Sync databases with the latest snapshot or share updates. - [REVOKE READ ON SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/revoke-access): Remove user access from a restricted share. - [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. - [TEMPORARY TABLES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/temporary-tables): Create local temporary tables for session-scoped data. - [UNDROP DATABASE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/undrop-database): Restore a dropped MotherDuck database within its snapshot retention window. - [UPDATE SHARE](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/update-share): Manually update a share with a new database snapshot. - [MD_ATTACHED_DATABASES](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-attached-databases): List databases attached to your DuckDB and MotherDuck session. - [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. - [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. - [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. - [MD_USER](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-user): Return the current MotherDuck user name. - [MD_USER_INFO](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-user-info): Return the current user's ID and name plus the organization's ID, name, plan type, and region. - [MD_VERSION](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/md-version): Inspect the loaded MotherDuck extension version and build hash. - [MotherDuck SQL](https://motherduck.com/docs/sql-reference/motherduck-sql-reference): MotherDuck-specific SQL extensions and cloud database management - [RESULT](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/result): Run a SELECT asynchronously and query its cached results like a table.