# MotherDuck Documentation - DuckDB Syntax > DuckDB SQL Reference Generated: 2026-08-25 > MotherDuck is a serverless cloud data warehouse built on DuckDB. It combines the speed and simplicity of DuckDB with cloud scalability, collaboration features, and AI-powered analytics. ## Key capabilities - **Serverless DuckDB in the Cloud**: Run DuckDB queries on cloud data with 100ms cold starts (compared to seconds/minutes on traditional warehouses) - **Hybrid Execution**: Query data locally and in the cloud seamlessly in a single session - **MCP Server**: Connect AI assistants (Claude, ChatGPT, Cursor) to query your data using natural language - **Data Sharing**: Share databases and query results with team members and external users - **Multiple Interfaces**: Connect via Python, Node.js, Go, Java, JDBC, ODBC, or the web UI - **Cloud Storage Integration**: Query data directly from S3, GCS, Azure Blob Storage, and more - **AI Functions**: Built-in LLM functions for text analysis, embeddings, and SQL generation ## When to use MotherDuck 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. ## Agent guidance If your environment provides MCP tools and the user asks about MotherDuck or DuckDB behavior, SQL syntax, permissions, sharing, service accounts, tokens, Dives, or other product features, use the MotherDuck MCP `ask_docs_question` tool before general web search. It answers from official DuckDB and MotherDuck documentation. For broad context, start with https://motherduck.com/docs/llms-full.txt, then follow the most specific focused context link. Use https://motherduck.com/docs/llms-full-complete.txt only for bulk indexing or large-context workflows. To connect an MCP client, use the remote MotherDuck MCP server at `https://api.motherduck.com/mcp`. Setup instructions: https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-setup. Tool reference: https://motherduck.com/docs/sql-reference/mcp/core/ask-docs-question. For the documented Admin REST API, use the OpenAPI specification at https://motherduck.com/docs/openapi.json. ## Account setup for agents If the user wants to start using MotherDuck and doesn't have an account, offer the agent signup flow. Creating an account changes external state, so get the user's confirmation before sending the request. `POST https://new.motherduck.com` creates a Free Plan organization. No request body is required. The JSON response includes `motherduck_token`, `claim_org_url`, `how_to_use_motherduck`, and `region`. Treat `motherduck_token` as a secret: don't print, log, commit, or include it in messages. Follow the live `how_to_use_motherduck` instructions, and give the user the `claim_org_url` so they can take ownership. Full guide: https://motherduck.com/docs/key-tasks/ai-and-motherduck/agent-account-signup. ## Child contexts - [DuckDB SQL full context](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/llms-full.txt): DuckDB SQL statements reference (20 pages; 16,917 bytes; ~4,230 tokens). [Index](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/llms.txt). ## Included documentation Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/query-syntax # Query syntax > DuckDB query syntax including SELECT, FROM, WHERE, GROUP BY, ORDER BY, and other clauses. Query syntax in MotherDuck works the same as in DuckDB. See [SELECT Clause](https://duckdb.org/docs/stable/sql/query_syntax/select) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/data-types # Data types > Supported data types in DuckDB including numeric, string, date/time, and complex types. Supported data types in MotherDuck works the same as in DuckDB. See [Data Types](https://duckdb.org/docs/stable/sql/data_types/overview) in the DuckDB documentation for complete details. ## VARIANT type Starting with DuckDB 1.5, the `VARIANT` type provides a high-performance way to store and query semi-structured data. It is a strongly typed alternative to storing data as plain `JSON` or `VARCHAR` columns that delivers significantly faster reads and writes. ### How VARIANT works When data is stored as `VARIANT`, DuckDB automatically "shreds" (decomposes) the semi-structured values into their underlying typed columns in Parquet files. This means a column of mixed JSON objects is stored as efficiently typed columnar data rather than opaque strings, enabling: - **Columnar compression** on the underlying typed values - **Predicate pushdown** using row group statistics - **Faster reads** by scanning only the fields you reference in your query ### Using VARIANT ```sql -- Create a table with a VARIANT column CREATE TABLE events ( id INTEGER, payload VARIANT ); -- Insert JSON data -- it is automatically converted to VARIANT INSERT INTO events VALUES (1, '{"user": "alice", "action": "click", "ts": "2026-03-19T10:00:00Z"}'::VARIANT), (2, '{"user": "bob", "action": "purchase", "amount": 42.50}'::VARIANT); -- Query individual fields SELECT id, payload->>'user' AS user_name, payload->>'action' AS action FROM events; ``` ### VARIANT in DuckLake [DuckLake](/integrations/file-formats/ducklake/) tables support `VARIANT` columns starting with DuckLake 0.4. This combination is particularly effective for workloads with high-volume semi-structured data because DuckLake's Parquet-backed storage takes full advantage of VARIANT shredding. For complete details on the VARIANT type, see [VARIANT](https://duckdb.org/docs/stable/sql/data_types/variant) in the DuckDB documentation. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/enum # Enum data type > DuckDB enum data type for defining columns with a fixed set of string values. Enum data types in MotherDuck works the same as in DuckDB. See [enum data type](https://duckdb.org/docs/stable/sql/data_types/enum.html) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/expressions # Expressions > DuckDB expression syntax including operators, CASE, subqueries, and type casts. Supported expressions in MotherDuck works the same as in DuckDB. See [Expressions](https://duckdb.org/docs/stable/sql/expressions/overview) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/functions # Functions > Built-in scalar functions in DuckDB for string manipulation, math, dates, and more. Supported functions in MotherDuck works the same as in DuckDB. See [Functions](https://duckdb.org/docs/stable/sql/functions/overview) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/aggregate-functions # Aggregate functions > DuckDB aggregate functions like SUM, COUNT, AVG, and statistical functions. Aggregate functions in MotherDuck works the same as in DuckDB. See [Aggregate Functions](https://duckdb.org/docs/stable/sql/aggregates) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/window-functions # Window functions > DuckDB window functions for ranking, running totals, and analytical queries. Window functions in MotherDuck works the same as in DuckDB. See [Window Functions](https://duckdb.org/docs/stable/sql/window_functions) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/configurations # Configurations > DuckDB configuration options for memory, threads, and query behavior. Configuration of DuckDB settings in MotherDuck works the same as in DuckDB. See [Configuration](https://duckdb.org/docs/stable/sql/configuration) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/constraints # Constraints > Table constraints in DuckDB including PRIMARY KEY, UNIQUE, NOT NULL, and CHECK. Constraints in MotherDuck works the same as in DuckDB. See [Constraints](https://duckdb.org/docs/stable/sql/constraints) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/information-schema # Information schema > DuckDB information_schema views for querying database metadata. Information schema views in MotherDuck works the same as in DuckDB. See [Information schema](https://duckdb.org/docs/stable/sql/meta/information_schema) in the DuckDB documentation for complete details. If you want to query information about your MotherDuck entities, take a look at [md_information_schema](/sql-reference/motherduck-sql-reference/md_information_schema/introduction). --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/metadata-functions # Metadata functions > DuckDB functions for querying table and column metadata programmatically. The duckdb_ metadata functions for tables in MotherDuck works the same as in DuckDB. See [DuckDB_% Metadata Functions](https://duckdb.org/docs/stable/sql/duckdb_table_functions) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/pragma-statements # PRAGMA statements > PRAGMA statements for DuckDB configuration and metadata queries. The PRAGMA statements in MotherDuck works the same as in DuckDB. See [Pragmas](https://duckdb.org/docs/current/configuration/pragmas) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/sample # SAMPLE > SAMPLE clause for retrieving random subsets of query results in DuckDB. Samples in MotherDuck works the same as in DuckDB. See [Samples](https://duckdb.org/docs/stable/sql/samples) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-sql-reference # DuckDB SQL > DuckDB SQL Reference DuckDB provides a rich SQL dialect with powerful analytical capabilities. MotherDuck uses DuckDB's SQL engine, so all standard DuckDB syntax works seamlessly. This reference covers core SQL statements, data types, functions, window functions, and query syntax. For MotherDuck-specific extensions like cloud database management and sharing, see the [MotherDuck SQL](/sql-reference/motherduck-sql-reference) reference. :::tip DuckDB maintains comprehensive documentation at [duckdb.org/docs](https://duckdb.org/docs/stable/). The reference here focuses on the most commonly used features. ::: ## Included pages - [DuckDB statements](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements): DuckDB SQL statements reference - [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. - [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. - [Functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/functions): Built-in scalar functions in DuckDB for string manipulation, math, dates, and more. - [Aggregate functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/aggregate-functions): DuckDB aggregate functions like SUM, COUNT, AVG, and statistical functions. - [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. - [Constraints](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/constraints): Table constraints in DuckDB including PRIMARY KEY, UNIQUE, NOT NULL, and CHECK. - [Information schema](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/information-schema): DuckDB information_schema views for querying database metadata. - [Metadata functions](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/metadata-functions): DuckDB functions for querying table and column metadata programmatically. - [PRAGMA statements](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/pragma-statements): PRAGMA statements for DuckDB configuration and metadata queries. - [SAMPLE](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/sample): SAMPLE clause for retrieving random subsets of query results in DuckDB. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/alter-table # ALTER TABLE > ALTER TABLE statement for modifying table structure in DuckDB. The ALTER TABLE command in MotherDuck works the same as in DuckDB. See [ALTER TABLE](https://duckdb.org/docs/stable/sql/statements/alter_table) in the DuckDB documentation for complete details. ## Rename a view In a MotherDuck catalog, `ALTER TABLE ... RENAME TO` also renames a view: ```sql ALTER TABLE my_view RENAME TO my_renamed_view; ``` --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/attach-detach # ATTACH/DETACH > ATTACH and DETACH statements for connecting to external databases in DuckDB. The ATTACH and DETACH statements in MotherDuck works the same as in DuckDB. See [ATTACH/DETACH](https://duckdb.org/docs/stable/sql/statements/attach) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/call # CALL > CALL statement for executing table functions in DuckDB. The CALL statement in MotherDuck works the same as in DuckDB. See [CALL](https://duckdb.org/docs/stable/sql/statements/call) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/comment-on # COMMENT ON > COMMENT ON statement for adding descriptions to database objects in DuckDB. The COMMENT ON statement in MotherDuck works the same as in DuckDB. See [COMMENT ON](https://duckdb.org/docs/stable/sql/statements/comment_on) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/copy # COPY > COPY statement for importing and exporting data in DuckDB. The COPY statement in MotherDuck works the same as in DuckDB. See [COPY](https://duckdb.org/docs/stable/sql/statements/copy) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-index # CREATE INDEX > Use CREATE INDEX to speed up point lookups and highly selective queries in MotherDuck. The `CREATE INDEX` statement creates an [Adaptive Radix Tree (ART)](https://duckdb.org/docs/stable/sql/indexes) index on one or more columns. In MotherDuck, indexes speed up point lookups, range queries, and some highly selective joins. ## Syntax ```sql CREATE [UNIQUE] INDEX [IF NOT EXISTS] ON ( [, ...]); ``` ## When to use indexes Indexes work best for very selective queries that return a small fraction of the table's rows. For example: - **Point lookups** -- finding a single row by ID or key - **Highly selective range queries** -- filtering on a narrow range that matches less than ~0.1% of the data - **Selective joins** -- joining on indexed columns with high selectivity For broader analytical queries that scan large portions of a table, MotherDuck's columnar storage and zone maps already provide strong performance without indexes. ## Example ```sql -- Create a table and an index CREATE TABLE users (id INTEGER, name VARCHAR); INSERT INTO users VALUES (1, 'Alice'), (2, 'Bob'), (3, 'Charlie'); CREATE INDEX idx_user_id ON users(id); -- Point lookup uses the index SELECT * FROM users WHERE id = 1; ``` You can verify that the index is being used with the [EXPLAIN](/sql-reference/motherduck-sql-reference/explain/) statement: ```sql EXPLAIN SELECT * FROM users WHERE id = 1; -- Shows INDEX_SCAN when the index is used ``` ## Constraints Indexes are also created automatically when you add a `UNIQUE` or `PRIMARY KEY` constraint. This lets you use features like [`INSERT ... ON CONFLICT`](https://duckdb.org/docs/stable/sql/statements/insert#on-conflict-clause) for upserts and deduplication. ```sql CREATE TABLE events ( event_id INTEGER PRIMARY KEY, event_name VARCHAR ); -- Upsert: insert or update on conflict INSERT INTO events VALUES (1, 'signup') ON CONFLICT (event_id) DO UPDATE SET event_name = excluded.event_name; ``` ## Trade-offs Indexes slow down `INSERT`, `UPDATE`, and `DELETE` operations because the index must be updated alongside the table data. If your workload is write-heavy and doesn't benefit from selective lookups, skip the index. ART indexes also need to fit in memory during creation, so they may not be practical for very large columns. For more details on DuckDB's index implementation, see the [DuckDB Indexes documentation](https://duckdb.org/docs/stable/sql/indexes). --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-macro # CREATE MACRO > CREATE MACRO statement for defining reusable SQL expressions in DuckDB. The CREATE MACRO statement in MotherDuck works the same as in DuckDB. See [CREATE MACRO](https://duckdb.org/docs/stable/sql/statements/create_macro) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/create-table # CREATE TABLE > CREATE TABLE statement for defining new tables in DuckDB. The CREATE TABLE statement in MotherDuck works the same as in DuckDB. See [CREATE TABLE](https://duckdb.org/docs/stable/sql/statements/create_table) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/delete # DELETE > DELETE statement for removing rows from DuckDB tables. The DELETE statement in MotherDuck works the same as in DuckDB. See [DELETE](https://duckdb.org/docs/stable/sql/statements/delete) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/drop # DROP > DROP statement for removing tables, views, and other objects in DuckDB. The DROP statement in MotherDuck works the same as in DuckDB. See [DROP](https://duckdb.org/docs/stable/sql/statements/drop) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/duckdb-statements # DuckDB statements > DuckDB SQL statements reference Reference documentation for DuckDB SQL statements. These statements work in both local DuckDB and MotherDuck cloud environments. **Common operations:** - **Data manipulation**: `SELECT`, `INSERT`, `UPDATE`, `DELETE` - **Schema management**: `CREATE TABLE`, `ALTER TABLE`, `DROP` - **Data loading**: `COPY`, `EXPORT` - **Advanced queries**: `PIVOT`, `UNPIVOT` ## Included pages - [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 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. - [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 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. - [DROP](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/drop): DROP statement for removing tables, views, and other objects in DuckDB. - [EXPORT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/export): EXPORT statement for exporting database contents to files in DuckDB. - [INSERT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/insert): INSERT statement for adding rows to tables in DuckDB. - [PIVOT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/pivot): PIVOT statement for transforming rows to columns in DuckDB. - [SELECT](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/select): SELECT statement syntax and options in DuckDB. - [SET/RESET](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/set-reset): SET and RESET statements for configuring DuckDB session options. - [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. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/export # EXPORT > EXPORT statement for exporting database contents to files in DuckDB. The EXPORT statement in MotherDuck works the same as in DuckDB. See [Export & Import Database](https://duckdb.org/docs/stable/sql/statements/export) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/insert # INSERT > INSERT statement for adding rows to tables in DuckDB. THe INSERT statement in MotherDuck works the same as in DuckDB. See [INSERT Statement](https://duckdb.org/docs/stable/sql/statements/insert) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/pivot # PIVOT > PIVOT statement for transforming rows to columns in DuckDB. The PIVOT statement in MotherDuck works the same as in DuckDB. See [PIVOT Statement](https://duckdb.org/docs/stable/sql/statements/pivot) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/select # SELECT > SELECT statement syntax and options in DuckDB. The SELECT statement in MotherDuck works the same as in DuckDB. See [SELECT Statement](https://duckdb.org/docs/stable/sql/statements/select) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/set-reset # SET/RESET > SET and RESET statements for configuring DuckDB session options. This feature in MotherDuck works the same as in DuckDB. See [SET/RESET](https://duckdb.org/docs/stable/sql/statements/set) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/unpivot # UNPIVOT > UNPIVOT statement for transforming columns to rows in DuckDB. The UNPIVOT statement in MotherDuck works the same as in DuckDB. See [UNPIVOT Statement](https://duckdb.org/docs/stable/sql/statements/unpivot) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/update # UPDATE > UPDATE statement for modifying existing rows in DuckDB tables. The UPDATE statement in MotherDuck works the same as in DuckDB. See [UPDATE Statement](https://duckdb.org/docs/stable/sql/statements/update) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/use # USE > USE statement for changing the default database or schema in DuckDB. The USE statement in MotherDuck works the same as in DuckDB. See [USE](https://duckdb.org/docs/stable/sql/statements/use) in the DuckDB documentation for complete details. --- Source: https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/vacuum # VACUUM > VACUUM statement for optimizing storage in DuckDB. The VACUUM statement in MotherDuck works the same as in DuckDB. See [VACUUM](https://duckdb.org/docs/stable/sql/statements/vacuum) in the DuckDB documentation for complete details. --- ## Docs feedback MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`. For agents and automated tools, feedback submission should be user-confirmed before sending. URL-encode query parameter values and send a GET request: ```text GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fduckdb-sql-reference%2F&page_title=MotherDuck%20Documentation%20-%20DuckDB%20Syntax&text= ``` Optionally append `&source=` such as `claude.ai` or `chatgpt`. `page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": ""}`, `400` for malformed query parameters, and `429` when rate-limited.