data-querying
Write and verify SQL queries with BigQuery. Use when executing bq commands, writing SQL queries, or including query results in documents. Trigger on "bq", "BigQuery", "query".
$ Installer
git clone https://github.com/yusuke-suzuki/dotfiles /tmp/dotfiles && cp -r /tmp/dotfiles/.claude/skills/data-querying ~/.claude/skills/dotfiles// tip: Run this command in your terminal to install the skill
SKILL.md
name: data-querying description: Write and verify SQL queries with BigQuery. Use when executing bq commands, writing SQL queries, or including query results in documents. Trigger on "bq", "BigQuery", "query".
Data Querying
Query Process
-
Dry run: Validate syntax and check cost
bq query --project_id=<PROJECT_ID> --use_legacy_sql=false --dry_run "SELECT ..."Cost: ~$5/TB. <1GB is light, 2GB+ needs optimization.
-
Execute: Run and confirm results
bq query --project_id=<PROJECT_ID> --use_legacy_sql=false --format=csv "SELECT ..." -
Learn: Study existing queries in project docs for patterns.
Query Design
- Specify exact date ranges
- Filter partitioned tables by partition key
- Avoid correlated subqueries (use JOINs/CTEs)
- Filter early with CTEs before joining large tables
Authentication
If bq query fails with authentication error, prompt user to run gcloud auth login and resume after login.
Repository

yusuke-suzuki
Author
yusuke-suzuki/dotfiles/.claude/skills/data-querying
1
Stars
0
Forks
Updated3m ago
Added1w ago