Dst List Tables
by mikkelkrogsholm
List all Danmarks Statistik tables currently stored in DuckDB with metadata. Use when user wants to know what data is available locally or explore stored tables.
Skill Details
Repository Files
1 file in this skill directory
name: dst-list-tables description: List all Danmarks Statistik tables currently stored in DuckDB with metadata. Use when user wants to know what data is available locally or explore stored tables.
DST List Tables Skill
Purpose
Discover what DST data is currently stored in the local DuckDB database. This is typically the first step in any analysis workflow - finding out what data you have to work with.
When to Use
- User asks "what data do we have?"
- Starting an analysis session
- Checking if specific data exists locally
- Exploring available tables
- Before deciding what to analyze
- Verifying data was stored successfully after fetch
How to Use
List All Tables
Show all tables stored locally:
python scripts/db/query_metadata.py --list-all
Get Specific Table Metadata
Get detailed metadata for one table:
python scripts/db/query_metadata.py --table-id <TABLE_ID>
JSON Output
Get machine-readable output:
python scripts/db/query_metadata.py --list-all --format json
Expected Output
List All Tables Format
Console-friendly table view:
================================================================================
DST TABLES IN LOCAL DATABASE
================================================================================
Found 3 table(s):
ID Name Records Age
--------------------------------------------------------------------------------
FOLK1A Population at first day 45231 5 days ago
AUP01 Employment statistics 12450 2 weeks ago
NABB3 Business statistics 8900 1 month ago
================================================================================
Metadata Fields
For each table, you'll see:
- table_id: Unique identifier (use in queries as
dst_{id}) - table_name: Human-readable description
- record_count: Number of rows in the table
- last_updated: When DST last updated the source data
- fetch_timestamp: When we downloaded it
- age: How old our local copy is (human-readable)
Example Metadata Output
======================================================================
METADATA FOR TABLE: FOLK1A
======================================================================
Table ID: FOLK1A
Table Name: Population at the first day of the quarter
Record Count: 45231
Last Updated: 2025-10-15T10:30:00
Fetch Timestamp: 2025-10-25T09:15:00
Data Age: 5 days ago
======================================================================
Interpreting Results
Table ID
- Use this for all queries
- Format in DuckDB:
dst_{table_id}(lowercase) - Example: FOLK1A → query as
dst_folk1a
Record Count
- Indicates dataset size
- Larger counts mean more data to analyze
- Compare with expected size to verify completeness
Fetch Timestamp
- When data was downloaded from DST
- Indicates freshness of local copy
- Compare with last_updated to see if source changed
Age
- Human-readable freshness indicator
- "5 days ago" means data is 5 days old locally
- Consider refreshing if too old for your needs
Next Steps
If Data Exists
Use query and analysis skills:
# Get table summary
python scripts/db/table_summary.py --table-id <TABLE_ID>
# Run SQL query
python scripts/db/query_data.py --sql "SELECT * FROM dst_<table_id> LIMIT 10"
If Data Missing
Switch to Fetcher Agent to download:
python scripts/fetch_and_store.py --table-id <TABLE_ID>
If Data Stale
Use dst-check-freshness skill to determine if refresh needed:
python scripts/db/query_metadata.py --table-id <TABLE_ID> --check-freshness --max-age-days 30
Examples
Example 1: List all stored tables
python scripts/db/query_metadata.py --list-all
Example 2: Get specific table metadata
python scripts/db/query_metadata.py --table-id FOLK1A
Example 3: JSON output for programmatic use
python scripts/db/query_metadata.py --list-all --format json
Example 4: Check multiple tables
# List all
python scripts/db/query_metadata.py --list-all
# Get details for each interesting table
python scripts/db/query_metadata.py --table-id FOLK1A
python scripts/db/query_metadata.py --table-id AUP01
Tips
At Session Start
- Always run --list-all first to see what you have to work with
- Note table IDs for tables you want to analyze
- Check ages to identify stale data
Data Quality
- Verify record counts seem reasonable
- Check fetch timestamps for freshness
- Compare last_updated vs fetch_timestamp
Table Naming
- Remember: table IDs become
dst_{id}in lowercase - FOLK1A → dst_folk1a
- AUP01 → dst_aup01
Empty Database
If no tables shown:
- Verify database file exists
- Use Fetcher Agent to download data
- Check fetch operations completed successfully
Common Workflows
Workflow 1: Start Analysis
# 1. See what's available
python scripts/db/query_metadata.py --list-all
# 2. Get details on interesting table
python scripts/db/query_metadata.py --table-id FOLK1A
# 3. Check data age
python scripts/db/query_metadata.py --table-id FOLK1A --check-freshness
# 4. Proceed with analysis
python scripts/db/table_summary.py --table-id FOLK1A
Workflow 2: Verify After Fetch
# 1. Fetch data
python scripts/fetch_and_store.py --table-id FOLK1A
# 2. Verify it's there
python scripts/db/query_metadata.py --table-id FOLK1A
# 3. Check record count is reasonable
Troubleshooting
"No tables found"
- Database may be empty
- Verify database file exists at path in .env
- Use Fetcher Agent to download data
"Table not found"
- Check spelling of table ID (case-sensitive)
- Run --list-all to see what exists
- Table may not have been fetched yet
Unexpected Record Counts
- May indicate partial fetch
- Check fetch logs for errors
- Consider re-fetching with --overwrite
Old Fetch Timestamps
- Data may be stale
- Use dst-check-freshness to evaluate
- Consider refreshing with Fetcher Agent
Related Skills
Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Analyzing Financial Statements
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
Data Storytelling
Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.
Kpi Dashboard Design
Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Sql Optimization Patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Xlsx
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
