BigQuery for Beginners: Datasets, Tables, SQL, Partitioning, Clustering, Pricing and Access Control

Google Cloud Platform Architect 60 min min read Updated: Nov 17, 2026 Beginner
BigQuery for Beginners: Datasets, Tables, SQL, Partitioning, Clustering, Pricing and Access Control
Beginner Topic 1 of 3

What Is BigQuery?

  • Google's serverless, petabyte-scale data warehouse. You write SQL and Google runs it on thousands of machines
  • Storage and compute are separate, so each scales and is billed on its own
  • Storage is columnar, so queries read only the columns they need
  • Also supports streaming, machine learning (BigQuery ML), geospatial, BI and querying data in Cloud Storage
TermMeaning
ProjectHolds billing and datasets
DatasetA folder of tables and views. It has a location (region or multi-region)
TableRows and columns (native, external, or a view)
JobA load, query, copy or export action

Your First Queries

sql -- Public dataset: no loading needed SELECT name, SUM(number) AS total FROM `bigquery-public-data.usa_names.usa_1910_2013` WHERE state = 'CA' GROUP BY name ORDER BY total DESC LIMIT 10;
bash bq mk --dataset --location=asia-south1 my-proj:sales bq load --autodetect --source_format=CSV --skip_leading_rows=1 sales.orders gs://acme-reports-482/orders.csv bq query --use_legacy_sql=false 'SELECT country, SUM(amount) revenue FROM sales.orders GROUP BY country ORDER BY revenue DESC' bq show --format=prettyjson sales.orders

Loading Data

MethodUse
Batch load (free)Files from Cloud Storage: CSV, JSON, Avro, Parquet, ORC
Streaming / Storage Write APIReal-time rows
Datastream / Dataflow / Pub/Sub subscriptionPipelines and change data capture
Data Transfer ServiceScheduled imports from SaaS and other clouds
External and BigLake tablesQuery files in place without loading

Partitioning and Clustering

  • Partitioned table: split by date/time column, ingestion time or integer range. Queries that filter on the partition scan only needed partitions
  • Clustered table: sort data by up to four columns so filters on them scan less
  • Use both: partition by date, cluster by customer_id
  • Set require_partition_filter to stop accidental full scans
sql CREATE TABLE sales.orders_p PARTITION BY DATE(order_ts) CLUSTER BY customer_id, country OPTIONS (require_partition_filter = TRUE, partition_expiration_days = 730) AS SELECT * FROM sales.orders; SELECT customer_id, SUM(amount) FROM sales.orders_p WHERE DATE(order_ts) BETWEEN '2026-11-01' AND '2026-11-17' AND country = 'IN' GROUP BY customer_id;

Pricing in Simple Terms

PartModel
StoragePer GB per month. Data not changed for 90 days becomes cheaper (long-term). Logical or physical billing
Analysis (on-demand)Per TB of data scanned by queries (a monthly free amount applies)
Analysis (capacity / editions)Pay for slots (compute units), with autoscaling, for predictable cost on heavy use
Streaming and some APIsPer volume
Loading and exportingBatch load free (using shared slots)

Controlling Cost

  1. Select only needed columns. Never SELECT * on big tables
  2. Filter on partition columns
  3. Use dry run to see bytes before running: bq query --dry_run
  4. Set maximum bytes billed per query and custom quotas per project or user
  5. Use LIMIT carefully: it does not reduce bytes scanned
  6. Use materialized views and BI Engine for repeated dashboards
  7. Set table expiration for temporary data
bash bq query --use_legacy_sql=false --dry_run 'SELECT * FROM sales.orders_p WHERE DATE(order_ts) = "2026-11-17"' bq query --use_legacy_sql=false --maximum_bytes_billed=10000000000 'SELECT country, COUNT(*) FROM sales.orders_p WHERE DATE(order_ts)="2026-11-17" GROUP BY 1'

Access Control

LevelHow
Project / datasetIAM roles such as bigquery.dataViewer, bigquery.dataEditor, bigquery.jobUser (to run queries)
Authorized viewsShare a view of selected columns or rows without giving access to the base table
Column-level securityPolicy tags from Data Catalog restrict sensitive columns
Row-level securityRow access policies show different rows to different users
Data maskingShow masked values for some users
CMEK, VPC Service Controls, audit logsEncryption, perimeter and tracking

Useful Features

  • Time travel: query data as it was up to 7 days ago
  • BigQuery ML: train models with SQL (CREATE MODEL)
  • Scheduled queries, materialized views, user-defined functions
  • Looker and Looker Studio for dashboards
  • BigQuery Omni to query data in AWS or Azure

Practice

  1. Run the public dataset query and check bytes processed
  2. Load a CSV from Cloud Storage with autodetect
  3. Create a partitioned and clustered copy and compare bytes scanned
  4. Create an authorized view that hides a salary column
  5. Set a maximum bytes billed on a query

Conclusion

BigQuery is a serverless SQL warehouse. Load data, query with standard SQL, partition and cluster to cut cost, choose on-demand or capacity pricing and secure data with IAM, authorized views and policy tags.

Quick Summary: what; first queries; loading; partition; pricing; cost control; access; features.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators