BigQuery fundamentals
GCP · 14 questions
Short notes
Key idea
BigQuery is Google's serverless data warehouse. You load data into tables inside datasets and query with standard SQL; there are no servers to manage, and on-demand pricing charges by bytes scanned.
Syntax
SELECT city, SUM(amount) AS revenue
FROM `my-project.sales.orders`
WHERE order_date >= '2024-01-01'
GROUP BY city;
- Names: project.dataset.table, in backticks.
- Loading: from GCS (CSV, JSON, Parquet), streaming, or
bq load. - External tables query files in GCS without loading.
- Views, scheduled queries,
CREATE TABLE AS SELECT. - Dry run shows bytes to be scanned before you run.
Example
bq load --source_format=PARQUET sales.orders gs://shop-raw/orders/*.parquet, then a scheduled query builds sales.daily_revenue each morning for the dashboard.
Traps
LIMITdoesn't reduce cost: BigQuery still reads the whole columns.SELECT *scans every column; name the ones you need.- Datasets have a location; you can't join tables across regions.
- Arrays and structs (nested fields) need
UNNESTto query.
Want the full lesson with step-by-step examples, a project and a certificate? GCP course, ₹120 →
Questions
5 free questions- Question 1easy
What does "serverless" mean for BigQuery?
- Question 2medium
With on-demand pricing, what mainly decides a query's cost?
- Question 3medium
What is a BigQuery external table?
- Question 4medium
Which is valid BigQuery SQL to truncate a date to its month?
- Question 5medium
A query reads 2 columns of a 50-column, 1 TB table. Roughly how much data does BigQuery scan?
BigQuery fundamentals
BigQuery fundamentals
BigQuery fundamentals
BigQuery fundamentals
BigQuery fundamentals
9 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.