skills/bfdcampos/bigquery/SKILL.md
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.
npx skillsauth add aiskillstore/marketplace bigqueryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
bq 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:
# 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:
bq query --project_id=monzo-analytics --use_legacy_sql=false \
"SELECT COUNT(*) as row_count FROM \`monzo-analytics.DATASET.TABLE_NAME\`"
Example:
bq query --project_id=monzo-analytics --use_legacy_sql=false \
"SELECT COUNT(*) as row_count FROM \`monzo-analytics.dims.vulnerable_customer_logs_dim\`"
bq 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:
bq 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:
bq 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:
bq 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:
bq 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:
bq 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:
# 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:
bq 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.
bq query --project_id=monzo-analytics --use_legacy_sql=false \
"SELECT * FROM \`monzo-analytics.DATASET.TABLE_NAME\` LIMIT 10"
Control how results are displayed:
# 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 dataQuerying actual content from:
When in doubt:
people, staff, hibob tablesError: "Not found: Table"
# 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"
# Solution: You may not have permissions for that project/dataset
# Try a different project or ask the user about access
Error: "Syntax error"
# Solution: Ensure you're using Standard SQL (--use_legacy_sql=false)
# Check backtick usage around project.dataset.table identifiers
Always use fully-qualified table names with backticks:
`project-id.dataset.table`
Use LIMIT for exploratory queries to avoid large result sets:
SELECT * FROM `project.dataset.table` LIMIT 10
Check row counts before running expensive queries:
# 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
Use dry-run for cost estimation (for expensive queries):
bq query --dry_run --use_legacy_sql=false "YOUR_QUERY_HERE"
Export large results to file:
bq query --project_id=monzo-analytics --use_legacy_sql=false \
--format=csv "YOUR_QUERY" > output.csv
# 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.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.