Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Comprehensive guide for using BigQuery CLI (bq) to query and inspect tables in Monzo's BigQuery projects, with emphasis on data sensitivity and INFORMATION_SCHEMA queries.
.claude/skills/aiskillstore-bigquery/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 199% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 363% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 180% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 121% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 170% | 0% |
This skill provides comprehensive guidance on using the BigQuery CLI (bq) for querying and inspecting data in Monzo's BigQuery projects.
--project_id=PROJECT_NAME--use_legacy_sql=falseUse this to inspect column names, types, and structure without accessing sensitive data:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT column_name, data_type, is_nullable FROM \`monzo-analytics.DATASET_NAME.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'TABLE_NAME' ORDER BY ordinal_position"
Examples:
bash# Check dims dataset table schema bq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT column_name, data_type FROM \`monzo-analytics.dims.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'vulnerable_customer_logs_dim' ORDER BY ordinal_position" # Check prod dataset table schema bq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT column_name, data_type FROM \`monzo-analytics.prod.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'transactions' ORDER BY ordinal_position"
Use COUNT(*) to check table size without exposing data:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT COUNT(*) as row_count FROM \`monzo-analytics.DATASET.TABLE_NAME\`"
Example:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT COUNT(*) as row_count FROM \`monzo-analytics.dims.vulnerable_customer_logs_dim\`"
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name, table_type FROM \`monzo-analytics.DATASET_NAME.INFORMATION_SCHEMA.TABLES\` ORDER BY table_name"
Example:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name FROM \`monzo-analytics.dims.INFORMATION_SCHEMA.TABLES\` ORDER BY table_name"
Useful for programmatic processing of table schemas:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ --format=csv --quiet \ "SELECT column_name FROM \`monzo-analytics.DATASET.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'TABLE_NAME' ORDER BY ordinal_position" \ | tail -n +2 > /tmp/columns.txt
Example:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ --format=csv --quiet \ "SELECT column_name FROM \`monzo-analytics.dims.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'vulnerable_customer_logs_dim' ORDER BY ordinal_position" \ | tail -n +2 > /tmp/columns.txt
Get table creation time, size, and other metadata:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name, creation_time, ROUND(size_bytes/1024/1024/1024, 2) as size_gb, row_count FROM \`monzo-analytics.DATASET_NAME.INFORMATION_SCHEMA.TABLES\` WHERE table_name = 'TABLE_NAME'"
Search for tables matching a naming pattern:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name FROM \`monzo-analytics.DATASET_NAME.INFORMATION_SCHEMA.TABLES\` WHERE table_name LIKE '%PATTERN%' ORDER BY table_name"
Example:
bash# Find all customer-related tables bq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name FROM \`monzo-analytics.dims.INFORMATION_SCHEMA.TABLES\` WHERE table_name LIKE '%customer%' ORDER BY table_name"
Get comprehensive column metadata including descriptions:
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT column_name, data_type, is_nullable, is_partitioning_column FROM \`monzo-analytics.DATASET.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'TABLE_NAME' ORDER BY ordinal_position"
⚠️ WARNING: Only use this on non-sensitive tables. Never query actual content from people/staff/PII tables.
bashbq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT * FROM \`monzo-analytics.DATASET.TABLE_NAME\` LIMIT 10"
Control how results are displayed:
bash# CSV format --format=csv # JSON format --format=json # Pretty table format (default) --format=prettyjson # Quiet mode (no status messages) --quiet # Maximum rows to return --max_rows=100
monzo-analytics - Main analytics warehousemonzo-analytics-v2 - New OOM architecture modelsmonzo-analytics-pii - PII-containing data (use with caution)sanitized-events-prod - Sanitised event dataraw-analytics-events-prod - Raw event datadims - Dimension tablesprod - Production tableslending - Lending-specific tablesslurpee - Slurpee datapeople, staff, hibob tablesError: "Not found: Table"
bash# Solution: Check the table exists first bq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT table_name FROM \`monzo-analytics.DATASET.INFORMATION_SCHEMA.TABLES\` WHERE table_name LIKE '%SEARCH_TERM%'"
Error: "Access Denied"
bash# Solution: You may not have permissions for that project/dataset # Try a different project or ask the user about access
Error: "Syntax error"
bash# Solution: Ensure you're using Standard SQL (--use_legacy_sql=false) # Check backtick usage around project.dataset.table identifiers
sql project-id.dataset.table
sql SELECT * FROM project.dataset.table LIMIT 10
bash # First check size bq query --project_id=monzo-analytics --use_legacy_sql=false \ "SELECT COUNT(*) FROM \project.dataset.table\"
# Then run full query if reasonable
bash bq query --dry_run --use_legacy_sql=false "YOUR_QUERY_HERE"
bash bq query --project_id=monzo-analytics --use_legacy_sql=false \ --format=csv "YOUR_QUERY" > output.csv
bash# Schema check bq query --project_id=PROJECT --use_legacy_sql=false \ "SELECT column_name, data_type FROM \`PROJECT.DATASET.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name = 'TABLE' ORDER BY ordinal_position" # Row count bq query --project_id=PROJECT --use_legacy_sql=false \ "SELECT COUNT(*) FROM \`PROJECT.DATASET.TABLE\`" # List tables bq query --project_id=PROJECT --use_legacy_sql=false \ "SELECT table_name FROM \`PROJECT.DATASET.INFORMATION_SCHEMA.TABLES\` ORDER BY table_name" # Table metadata bq query --project_id=PROJECT --use_legacy_sql=false \ "SELECT table_name, row_count, size_bytes FROM \`PROJECT.DATASET.INFORMATION_SCHEMA.TABLES\` WHERE table_name = 'TABLE'"
Invoke this skill when you need to:
When working on dbt models in the analytics repository:
Remember: Always respect data sensitivity guidelines and use INFORMATION_SCHEMA when possible.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | fail→fail | 14,733 | 11,497 | -22% | 1 | 1 | 0% | 1,623 | 3,704 | +128% | 0 | 0 | — |
case-13 | fail→pass | 10,847 | 7,556 | -30% | 1 | 1 | 0% | 1,000 | 2,991 | +199% | 0 | 0 | — |
case-01 | fail→pass | 4,654 | 8,808 | +89% | 1 | 1 | 0% | 723 | 3,351 | +363% | 0 | 0 | — |
case-02 | fail→pass | 7,083 | 3,463 | -51% | 1 | 1 | 0% | 1,168 | 3,266 | +180% | 0 | 0 | — |
case-03 | fail→pass | 13,714 | 8,633 | -37% | 1 | 1 | 0% | 1,499 | 3,309 | +121% | 0 | 0 | — |
case-04 | fail→pass | 7,659 | 9,713 | +27% | 1 | 1 | 0% | 1,302 | 3,520 | +170% | 0 | 0 | — |
case-05 | fail→pass | 8,129 | 3,154 | -61% | 1 | 1 | 0% | 1,452 | 3,300 | +127% | 0 | 0 | — |
case-06 | pass→pass | 15,934 | 11,470 | -28% | 1 | 1 | 0% | 1,677 | 3,606 | +115% | 0 | 0 | — |
case-11 | pass→pass | 5,669 | 9,287 | +64% | 1 | 1 | 0% | 980 | 3,308 | +238% | 0 | 0 | — |
case-07 | fail→pass | 5,756 | 10,529 | +83% | 1 | 1 | 0% | 1,031 | 3,615 | +251% | 0 | 0 | — |
case-08 | pass→pass | 9,179 | 9,098 | -1% | 1 | 1 | 0% | 1,448 | 3,327 | +130% | 0 | 0 | — |
case-09 | fail→pass | 9,046 | 3,520 | -61% | 1 | 1 | 0% | 1,474 | 3,271 | +122% | 0 | 0 | — |
case-10 | fail→pass | 10,051 | 9,269 | -8% | 1 | 1 | 0% | 794 | 3,338 | +320% | 0 | 0 | — |
case-14 | pass→pass | 13,527 | 4,348 | -68% | 1 | 1 | 0% | 1,569 | 3,406 | +117% | 0 | 0 | — |
case-15 | fail→pass | 12,078 | 8,927 | -26% | 1 | 1 | 0% | 1,221 | 3,331 | +173% | 0 | 0 | — |
case-16 | fail→pass | 13,791 | 8,001 | -42% | 1 | 1 | 0% | 1,355 | 3,173 | +134% | 0 | 0 | — |
case-17 | fail→pass | 14,039 | 12,708 | -9% | 1 | 1 | 0% | 1,581 | 3,473 | +120% | 0 | 0 | — |
case-18 | pass→pass | 13,228 | 3,180 | -76% | 1 | 1 | 0% | 1,299 | 3,049 | +135% | 0 | 0 | — |
case-19 | pass→pass | 11,122 | 3,260 | -71% | 1 | 1 | 0% | 967 | 3,206 | +232% | 0 | 0 | — |
case-20 | pass→pass | 13,487 | 9,145 | -32% | 1 | 1 | 0% | 1,527 | 4,411 | +189% | 0 | 0 | — |
case-21 | pass→pass | 3,002 | 4,428 | +48% | 1 | 1 | 0% | 517 | 3,469 | +571% | 0 | 0 | — |
case-22 | pass→pass | 3,907 | 5,540 | +42% | 1 | 1 | 0% | 648 | 3,491 | +439% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.