Skip to content
Back to skills

Collection

ASecurity

Use when working with SQLite databases in DataPeeker analysis sessions - querying data, importing CSVs, exploring schemas, formatting output, or optimizing performance. Provides task-oriented guidance for effective SQLite CLI usage in data analysis workflows.

  • 24 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 8, 2026
datapythonsqltestingdebuggingdatabaseperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-e7c7d50a/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-e7c7d50a)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: using-sqlite
description: Use when working with SQLite databases in DataPeeker analysis sessions - querying data, importing CSVs, exploring schemas, formatting output, or optimizing performance. Provides task-oriented guidance for effective SQLite CLI usage in data analysis workflows.
---

# Using SQLite

## Overview

SQLite is the primary database for DataPeeker analysis sessions. This skill provides task-oriented guidance for common SQLite operations during data analysis.

**Core principle:** Explore schema first, format output for readability, write efficient queries, verify all operations.

## When to Use

Use this skill when you need to:
- Explore an unfamiliar database schema
- Query data for analysis or hypothesis testing
- Import CSV files into SQLite tables
- Format query output for readability
- Diagnose slow queries or optimize performance
- Understand which CLI invocation pattern to use

**When NOT to use:**
- Database-agnostic data profiling (see `understanding-data` skill for patterns that work across all SQL databases)
- Complex data cleaning logic (delegate to `cleaning-data` skill + sub-agents)
- Statistical analysis (use Python/pandas for advanced statistics)
- Large-scale transformations (use Python sqlite3 module)

## DataPeeker Conventions

```
Database Path:    data/analytics.db (relative from project root)
Table Naming:     raw_* for imported data, clean_* for cleaned data
Single Database:  All tables in one file per analysis session
```

**Example workflow:**
```
CSV file → raw_sales → clean_sales → Analysis queries
```

## Quick Reference

| Task | Guidance File |
|------|---------------|
| Understand what tables/columns exist | @./exploring-schema.md |
| Make query results readable | @./formatting-output.md |
| Write analytical queries | @./writing-queries.md |
| Load CSV files | @./importing-data.md |
| Fix slow queries | @./optimizing-performance.md |
| Choose CLI invocation method | @./invoking-cli.md |

## Task-Oriented Guidance

### Exploring Schema

**Before writing queries, understand the database structure.**

See @./exploring-schema.md for:
- Listing all tables (.tables)
- Viewing table structure (.schema, PRAGMA table_info)
- Understanding column types and constraints
- Checking for indexes

**When:** Starting analysis, unfamiliar database, before writing joins

---

### Formatting Output

**Make query results readable for analysis.**

See @./formatting-output.md for:
- Output modes (column, csv, json, markdown)
- Showing/hiding headers (.headers on/off)
- Setting column widths for readability
- Redirecting output to files

**When:** Query results hard to read, need specific format for export, preparing reports

---

### Writing Queries

**SQLite-specific query patterns and conventions.**

See @./writing-queries.md for:
- SQLite idioms used in DataPeeker (COUNT(*) - COUNT(col) for NULLs)
- Date handling with STRFTIME
- DataPeeker percentage calculation conventions
- Common verification queries

**See also:** `writing-queries` and `understanding-data` skills for database-agnostic SQL patterns and data profiling approaches. This guidance focuses on SQLite-specific syntax, CLI usage, and optimizations.

**When:** Need SQLite-specific syntax, DataPeeker query conventions, date formatting with STRFTIME

---

### Importing Data

**Load CSV files and verify import success.**

See @./importing-data.md for:
- Using .import command
- Verification queries (row counts, sample data)
- When to use CLI vs Python sqlite3
- Transaction handling

**When:** Loading new data, Phase 4 of importing-data skill, verifying data loaded correctly

---

### Optimizing Performance

**Diagnose and fix slow queries.**

See @./optimizing-performance.md for:
- EXPLAIN QUERY PLAN analysis
- Creating indexes for common queries
- Using transactions for bulk operations
- PRAGMA optimization

**When:** Query takes >1 second, loading large datasets, repeated similar queries

---

### Invoking CLI

**Choose the right method to run sqlite3 commands.**

See @./invoking-cli.md for:
- Interactive mode (for exploration)
- Heredoc pattern (for multi-command scripts)
- File redirect (for SQL files)
- One-liner mode (for quick checks)

**When:** Starting any SQLite operation, unsure which invocation to use

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| Writing queries without exploring schema | Always run .tables and .schema first |
| Poor output formatting (hard to read results) | Use .mode column and .headers on for readability |
| Ignoring NULL values in calculations | Use COUNT(*) - COUNT(col) for NULL counting |
| Integer division losing decimals | Use 100.0 (not 100) for percentage calculations |
| Slow queries without diagnosis | Run EXPLAIN QUERY PLAN before optimizing |
| Assuming import succeeded | Always verify with SELECT COUNT(*) after import |
| Using wrong CLI invocation pattern | Interactive for exploration, heredoc for scripts |

## Verification Before Proceeding

**After any import operation:**
```sql
-- 1. Verify row count matches expectation
SELECT COUNT(*) FROM raw_table;

-- 2. Check sample data looks correct
SELECT * FROM raw_table LIMIT 5;

-- 3. Verify no unexpected NULLs
SELECT COUNT(*) - COUNT(critical_column) FROM raw_table;
```

**After writing a complex query:**
```sql
-- 1. Check query plan
EXPLAIN QUERY PLAN SELECT ...;

-- 2. Time the query
.timer on
SELECT ...;
```

## Real-World Impact

**Systematic approach prevents:**
- Writing queries against wrong tables (explore schema first)
- Unreadable output (format before analyzing)
- Slow queries (diagnose with EXPLAIN QUERY PLAN)
- Silent data loss (verify imports)
- Incorrect percentages (use float division)

**Following this skill:**
- Reduces query debugging time by 50%+
- Catches import issues immediately
- Produces readable analysis artifacts
- Ensures reproducible workflows

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

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

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.