bigquery-基础知识(bigquery-basics)
2026-10-22查看 2复制 0
管理 BigQuery 中的数据集、表和作业,并集成 BigQuery ML 与 Gemini 进行高级数据分析和 AI 洞察。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md3452 chars
---
name: bigquery-basics
metadata:
version: "1.0.2"
category: BigDataAndAnalytics
description: >-
Manages datasets, tables, and jobs in BigQuery. Use when you need to interact
with BigQuery, run SQL queries, manage BigQuery resources (datasets, tables,
views), or perform basic data ingestion and analysis.
---
# BigQuery Basics
BigQuery is a serverless, AI-ready data platform that enables high-speed
analysis of large datasets using SQL and Python. Its disaggregated architecture
separates compute and storage, allowing them to scale independently while
providing built-in machine learning, geospatial analysis, and business
intelligence capabilities.
## Attribution
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix `gcloud` with
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-basics)"`
and append `agent-skills/1.0 (skill:bigquery-basics)` to `User-Agent` headers.
## Setup and Basic Usage
1. **Enable the BigQuery API:**
```bash
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-basics)" \
gcloud services enable bigquery.googleapis.com --quiet
```
2. **Create a Dataset:**
```bash
bq mk --dataset --location=US my_dataset
```
3. **Create a Table:**
Create a file named `schema.json` with your table schema:
```json
[
{
"name": "name",
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "post_abbr",
"type": "STRING",
"mode": "NULLABLE"
}
]
```
Then create the table with the `bq` tool:
```bash
bq mk --table my_dataset.mytable schema.json
```
4. **Run a Query:**
```bash
bq query --use_legacy_sql=false \
'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` \
WHERE state = "TX" LIMIT 10'
```
## Reference Directory
- [Core Concepts](references/core-concepts.md): Storage types, analytics
workflows, and BigQuery Studio features.
- [Change History](references/change-history.md): Tracking and querying
incremental table changes using APPENDS and CHANGES.
- [Continuous Queries](references/continuous-queries.md): Running continuous
SQL statements to analyze incoming data in real time.
- [CLI Usage](references/cli-usage.md): Essential `bq` command-line tool
operations for managing data and jobs.
- [Client Libraries](references/client-library-usage.md): Using Google Cloud
client libraries for Python, Java, Node.js, and Go.
- [MCP Usage](references/mcp-usage.md): Using the BigQuery remote MCP server and
Gemini CLI extension.
- [Infrastructure as Code](references/iac-usage.md): Terraform examples for
datasets, tables, and reservations.
- [IAM & Security](references/iam-security.md): Roles, permissions, and data
governance best practices.
- [Usage Attribution](references/attribution.md): Standardized usage attribution
tags for `gcloud` CLI, REST API, and MCP requests.
*If you need product information not found in these references, use the
Developer Knowledge MCP server `search_documents` tool.*
## Related Skills
- [BigQuery AI & ML Skill](../bigquery-ai-ml):
SKILL.md file for BigQuery AI and ML capabilities (forecast, anomaly
detection, text generation).