bigquery-basics
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 的基本设置方式,以及如何使用 SQL 分析大型数据集。
- 使用时机
- 需要激活 BigQuery API、创建数据集或数据表,或运行 SQL 查找的范例时使用。
- 输出结果
- 提供设置指令、数据表结构范例与查找数据的 SQL 范例。
上游变更(16 条,最新收录 2026-09-21)
0ecc2fc Update bigquery-basics skill with standardized metrics tracking (agent-skills). 添加直接运行的 gcloud 指令及 BigQuery HTTP/MCP 请求的归因指引,并在 gcloud 范例中加入归因环境变量。 e08ada0 Add documentation for BigQuery continuous queries to the BigQuery agent skills. 添加 BigQuery 连续查找及实时 SQL 分析的参考文档链接。 6617ca7 Add documentation for BigQuery Change History to the BigQuery agent skills. 添加变更历史参考文档,说明如何使用 APPENDS 和 CHANGES 追踪增量数据表变更。 c75b500 Restructure the YAML frontmatter in all SKILL.md files to nest the 'category' field under the 'metadata:' block. The 'category' field is used to organize the skills in the README.md 添加 metadata 前置数据区块,并将 BigDataAndAnalytics 类别移至其中。 14a8f36 Adding BQ AI anomaly detection reference 添加 AI Detect Anomalies 参考项目,并从相关 AI/ML 参考清单移除其文件项目。 d59d0e2 Upload BigQuery AI.FORECAST skill 添加 AI Forecast 参考项目,重新排版相关 AI/ML 参考清单,并移除其中的 forecast 文件项目。 6f0b877 Nests cloud/ skills under a top level skills/ directory 将技能文件从 cloud/bigquery-basics/SKILL.md 移至 skills/cloud/bigquery-basics/SKILL.md,内容未变更。 9114a94 Flatten skill directories to work with multiple installation tools 将技能文件从 cloud/products/bigquery/bigquery-basics/SKILL.md 移至 cloud/bigquery-basics/SKILL.md,内容未变更。 npx skills add "lettucebo/Skills#v2.2.0@bigquery-basics" --full-depth ⚠ v2.2.0 发布后即可使用
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
Tag every BigQuery command you execute directly in the terminal while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data.
Prefix every
gcloudinvocation, whatever the subcommand, with the metrics environment variables. Set them inline on each command; shell state may not persist between commands:CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-basics)" \ gcloud <command> [flags]Do not use
gcloud config setfor this: it would persist beyond the current task and mislabel unrelated usage.On direct HTTP calls to the BigQuery APIs (for example with
curl) or HTTP requests to the MCP server, append this exact string to the end of the existing User-Agent header — the collection pipeline parses theagent-skills/<version>andskill:<name>tokens, so any rewording breaks attribution:User-Agent: <existing_user_agent> agent-skills/1.0 (skill:bigquery-basics)Constraint for Generated Code: The tracking prefix is strictly for commands you execute directly in the terminal. Do NOT include this tracking prefix in generated scripts, Terraform templates, or code provided to the user for their own repositories.
Setup and Basic Usage
Enable the BigQuery API:
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-basics)" \ gcloud services enable bigquery.googleapis.com --quietCreate a Dataset:
bq mk --dataset --location=US my_datasetCreate a Table:
Create a file named
schema.jsonwith your table schema:[ { "name": "name", "type": "STRING", "mode": "REQUIRED" }, { "name": "post_abbr", "type": "STRING", "mode": "NULLABLE" } ]Then create the table with the
bqtool:bq mk --table my_dataset.mytable schema.jsonRun a Query:
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: Storage types, analytics workflows, and BigQuery Studio features.
Change History: Tracking and querying incremental table changes using APPENDS and CHANGES.
Continuous Queries: Running continuous SQL statements to analyze incoming data in real time.
CLI Usage: Essential
bqcommand-line tool operations for managing data and jobs.Client Libraries: Using Google Cloud client libraries for Python, Java, Node.js, and Go.
MCP Usage: Using the BigQuery remote MCP server and Gemini CLI extension.
Infrastructure as Code: Terraform examples for datasets, tables, and reservations.
IAM & Security: Roles, permissions, and data governance best practices.
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: SKILL.md file for BigQuery AI and ML capabilities (forecast, anomaly detection, text generation).