dst-query

Execute SQL queries on DST tables stored in DuckDB.

2|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill dst-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dst-query
Source: https://github.com/mikkelkrogsholm/dst-skills/tree/main/.claude/skills/dst-query
Command: npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill dst-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Analysts need to filter, aggregate, join, and inspect DST data stored locally. This Skill provides a core SQL-based interface to explore and summarize data.

Core Features & Use Cases

  • SQL execution: Run arbitrary SQL against DST tables stored in DuckDB.
  • Table summaries: DESCRIBE and quick stats to understand schema.
  • Joins & aggregations: Combine multiple DST tables to derive insights.

Quick Start

python scripts/db/query_data.py --sql "SELECT * FROM dst_folk1a WHERE område = '000' LIMIT 10"

Frequently Asked Questions about dst-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run SQL queries on DST data stored in DuckDB?

Execute SQL queries on DST data in DuckDB using the query_data.py script with the --sql flag. You can filter, aggregate, and join multiple DST tables to extract insights, handling suppressed values (..), safe numeric casting, and aggregate codes natively.

Can I filter and aggregate DST data without writing complex scripts?

Yes. SQL filtering and aggregation work directly on DST tables in DuckDB. Use WHERE clauses to filter by fields like område, GROUP BY for summaries, and built-in functions for custom statistics across multiple DST tables.

How do I understand the structure of my DST tables before querying?

Use DESCRIBE and the table_summary utility to inspect schema and generate quick statistics. This reveals column names, data types, and row counts to guide your query design.

Does DuckDB handle DST time codes like 2024K1 and 2024M01 correctly in queries?

Yes. DuckDB's SQL engine natively supports proper sorting and comparison of DST time codes in multiple formats. Queries sort these codes correctly without manual conversion or parsing.

What happens if I run a query that returns too many rows from a DST table?

A safety LIMIT is enforced to prevent resource exhaustion. All queries must include a LIMIT clause or operate within the enforced safety constraint to control result set size.