BigQuery is Google Cloud's fully-managed, serverless data warehouse designed for fast, scalable SQL analytics on petabyte-scale datasets. Built on Google's Dremel columnar storage architecture, it separates storage from compute, enabling elastic resource allocation and cost-effective querying. Beyond SQL analytics, BigQuery now functions as an autonomous data-to-AI platform with built-in vector search, native LLM inference via Gemini, and real-time continuous queriesβall accessible through standard SQL. A critical mental model: cost is primarily driven by data scannedβoptimizing queries with partitioning, clustering, and column selection directly reduces both latency and billing.
What This Cheat Sheet Covers
This topic spans 22 focused tables and 221 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Data Types
| Type | Example | Description |
|---|---|---|
SELECT 42 AS count | β’ Only integer type in BigQuery β signed 64-bit integer ranging from -2βΆΒ³ to 2βΆΒ³-1 β’ use for IDs, counts, and join keys | |
SELECT 3.14159 AS pi | β’ Double-precision floating point β IEEE 754 standard β’ use for measurements and calculations where precision loss is acceptable | |
SELECT NUMERIC '99.99' AS price | Exact decimal with 38 digits of precision and 9 decimal places β ideal for financial calculations requiring exact arithmetic | |
SELECT BIGNUMERIC '1e100' AS large | Extended precision decimal with 76 digits of precision and 38 decimal places β for extremely large or precise calculations | |
SELECT 'Hello' AS greeting | β’ Variable-length UTF-8 text β no length limit β’ use for text, URLs, and categorical data | |
SELECT TRUE AS flag | β’ Boolean β TRUE, FALSE, or NULL β’ use in WHERE clauses and conditional logic | |
SELECT TIMESTAMP '2026-03-04 10:30:00 UTC' | β’ Absolute point in time β always in UTC internally β’ automatically converts timezones β’ most common for event data | |
SELECT DATE '2026-03-04' AS today | β’ Calendar date β format YYYY-MM-DD, range 0001-01-01 to 9999-12-31 β’ use for day-level partitioning |