Skip to content
Back to skills

Bigquery 1

ASecurity

Instructions for querying Google BigQuery using the bq command-line tool. Useful for running SQL queries, exploring datasets, and exporting results.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
databasesgobashsqldatabase

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill bigquery-1 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bigquery 1?

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

Security grade badge for Bigquery 1
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-bigquery-1/badge)](https://www.skillsdirectory.com/skills/david-li0406-bigquery-1)

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: bigquery
description: Instructions for querying Google BigQuery using the bq command-line tool. Useful for running SQL queries, exploring datasets, and exporting results.
---

# BigQuery Skill

This skill enables you to query Google BigQuery using the `bq` command-line tool.

Authentication is already configured. The default project is `project_id`.

Use the `project_id_exploration` dataset as scratch space for temporary tables and experimentation.

The `public` dataset contains tables synced from the production Postgres database.

## 1. Explore Available Datasets

List datasets in the current project (defaults to `project_id`):

```bash
bq ls
```

List datasets in a specific project:

```bash
bq ls --project_id=PROJECT_ID
```

List tables in a dataset:

```bash
bq ls PROJECT_ID:DATASET_NAME
```

Get table schema:

```bash
bq show --schema --format=prettyjson PROJECT_ID:DATASET_NAME.TABLE_NAME
```

## 2. Run Queries

**Run a simple query:**

```bash
bq query --use_legacy_sql=false 'SELECT * FROM `project.dataset.table` LIMIT 10'
```

**Run a query with formatted output:**

```bash
bq query --use_legacy_sql=false --format=prettyjson 'YOUR_QUERY'
```

**Run a query and save to a destination table:**

```bash
bq query --use_legacy_sql=false --destination_table=PROJECT:DATASET.NEW_TABLE 'YOUR_QUERY'
```

**Run a dry run to estimate costs:**

```bash
bq query --use_legacy_sql=false --dry_run 'YOUR_QUERY'
```

## 3. Export Results

**Export to CSV:**

```bash
bq query --use_legacy_sql=false --format=csv 'YOUR_QUERY' > results.csv
```

## 4. Best Practices

- Always use `--use_legacy_sql=false` for standard SQL syntax
- Use `LIMIT` clauses when exploring data to reduce costs
- Use `--dry_run` to estimate query costs before running expensive queries
- Use backticks around table references: `` `project.dataset.table` ``

## 5. Common Patterns

**Preview table data:**

```bash
bq head -n 10 PROJECT:DATASET.TABLE
```

**Get table info (row count, size):**

```bash
bq show --format=prettyjson PROJECT:DATASET.TABLE
```

**Query with parameters:**

```bash
bq query --use_legacy_sql=false --parameter='name:STRING:value' 'SELECT * FROM `table` WHERE col = @name'
```

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.

Comments

Loading comments…