Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Duckdb Sql

ASecurity

Load when hitting DuckDB syntax errors or writing DuckDB-specific SQL. Covers gotchas that differ from PostgreSQL/MySQL.

483 stars
0 votes
0 copies
0 views
Added 9/3/2026
databasesgosql

Security Analysis

A100/100

Scanned 9/3/2026

Install to Claude Code

$npx -y skills add SignalPilot-Labs/SignalPilot --skill duckdb-sql --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Duckdb Sql?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Duckdb Sql
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/signalpilot-labs-duckdb-sql-6c0811ba/badge)](https://www.skillsdirectory.com/skills/signalpilot-labs-duckdb-sql-6c0811ba)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: duckdb-sql
description: "Load when hitting DuckDB syntax errors or writing DuckDB-specific SQL. Covers gotchas that differ from PostgreSQL/MySQL."
type: skill
---

# DuckDB SQL - Key Differences from PostgreSQL/MySQL

## Gotchas

- **Integer division truncates**: `5/2 = 2`. Fix: `CAST(numerator AS DOUBLE) / denominator`
- **DATE_TRUNC returns TIMESTAMP**: Cast result if DATE needed: `CAST(DATE_TRUNC('month', col) AS DATE)`
- **INTERVAL syntax**: `INTERVAL '1' DAY` (quoted), NOT `INTERVAL 1 DAY`
- **No DATEADD/DATEDIFF**: In standalone queries, use `col + INTERVAL '1' DAY` and `DATE_DIFF('day', start, end)` - DuckDB has no `DATEADD`/`DATEDIFF` function.
- **SUM(NULL) = NULL**: Not 0. Use `COALESCE(SUM(col), 0)` if 0 is needed.
- **inf/NaN checks**: use `isinf(col)` and `isnan(col)`, NOT `IS_INF`/`IS_NAN` (those are BigQuery function names).
- **ROUND precision**: If the YML specifies a decimal type like `decimal(6,2)`,
  cast the FINAL output to match: `CAST(ROUND(AVG(col), 2) AS DECIMAL(6,2))`.
  Do NOT cast the input - cast the result after rounding.
- **Avoid CURRENT_DATE for date spines** - when generating or capping a calendar over historical data, use `(SELECT MAX(date_col) FROM source)` to anchor to the data's actual date range

## Date Parsing

- Non-ISO strings: `STRPTIME(col, '%d/%m/%Y')::DATE`
- `TRY_STRPTIME` returns NULL on failure (safe)
- Never `CAST(date_str AS DATE)` on non-ISO strings

## QUALIFY Clause

Filter window function results without a subquery:
```sql
SELECT *, ROW_NUMBER() OVER (PARTITION BY group ORDER BY col DESC) AS rn
FROM table
QUALIFY rn <= 10
```

## Date Spines

```sql
SELECT UNNEST(GENERATE_SERIES(min_date::DATE, max_date::DATE, INTERVAL '1' DAY)) AS date_day
```
Always use the primary fact table's max date as endpoint - call `get_date_boundaries` first.

## Type Casting

`CAST(x AS INTEGER)`, `CAST(x AS DOUBLE)`, `CAST(x AS VARCHAR)`, `CAST(x AS DATE)`
`TRY_CAST` returns NULL on failure.

Attribution

SignalPilot-LabsSignalPilot-Labs
View sourceMore from SignalPilot-Labs →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Database Optimizer

Expert database optimizer specializing in modern performance

458250 votes
View all in databases →