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).