duckdb-sql
DuckDB SQL Reference for MotherDuck
Use this skill when you need exact DuckDB syntax, function behavior, or a quick sanity check that a statement will actually work on MotherDuck.
Source Of Truth
- Prefer current DuckDB SQL docs for language features and function semantics.
- Use current MotherDuck SQL docs for MotherDuck-only commands such as shares, secrets, snapshots, and Dive operations.
- If the connection path matters, verify behavior against the current Postgres-endpoint docs before promising server-mode support.
Default Posture
- Write DuckDB SQL, not PostgreSQL SQL, even when the client connects through the Postgres endpoint.
- Use fully qualified
"database"."schema"."table"names once more than one database or share is in scope. - Prefer DuckDB-native constructs when they simplify the query:
GROUP BY ALL,QUALIFY,UNION BY NAME,arg_max,EXCLUDE, andREPLACE. - Check whether the statement depends on local files, extension install/load, temporary-table behavior, or other client-only features before claiming it will work in MotherDuck.
- Treat MotherDuck SQL as an additional surface on top of DuckDB SQL, not a replacement for it.
Workflow
- Confirm the connection path and whether the question is about syntax, feature support, or a specific error.
- Write or repair the statement in DuckDB SQL first.
- Verify any MotherDuck-only command or server-mode limitation against the current docs.
- If the user needs exact syntax or function details, open
references/SYNTAX_REFERENCE.md.
Open Next
references/SYNTAX_REFERENCE.mdfor DuckDB data types, friendly SQL features, functions, complex types, and common MotherDuck-specific gotchas
Related Skills
queryfor writing and validating analytical SQL against live MotherDuck dataconnectwhen syntax support depends on PG endpoint versus native DuckDB behaviorexplorewhen the problem is really missing schema context rather than missing syntax knowledge
More from motherduckdb/agent-skills
motherduck-security-governance
Explain MotherDuck security, governance, and access-control patterns. Use when a security_compliance_owner, technical_owner, or application_builder is asking about residency, access boundaries, service accounts, isolation, sharing, or governance posture.
47motherduck-query
Execute DuckDB SQL queries against MotherDuck databases. Use when running analytics, aggregations, transformations, or any SQL operation. Covers query best practices, CTEs, window functions, QUALIFY, and performance optimization.
43motherduck-build-data-pipeline
Design an end-to-end MotherDuck pipeline. Use when choosing raw, staging, and analytics boundaries, bulk ingestion paths, transformation sequencing, publication targets, or whether DuckLake is actually required.
43motherduck-pricing-roi
Explain MotherDuck pricing and ROI tradeoffs. Use when an economic_buyer, technical_owner, or analytics_lead is asking about spend, budget guardrails, workload cost drivers, plan fit, or whether MotherDuck is worth adopting.
43motherduck-ducklake
Decide when DuckLake is the right MotherDuck storage pattern. Use when evaluating fully managed DuckLake, BYOB, own-compute DuckLake access, data inlining, object-storage layout, or file-aware maintenance instead of native MotherDuck storage.
43motherduck-create-dive
Create, edit, manage, share, or embed MotherDuck Dives. Use when the work involves Dive authoring, live React + SQL components, MCP get_dive_guide, useSQLQuery, local preview, version history, Dives-as-code, required resources, team sharing, or embedded Dive sessions.
43