# BigQuery Reference: SQL Functions, Errors, Pricing and Guides | Masthead

Everything you need to run BigQuery well: SQL function and syntax reference with runnable examples, error messages and fixes, pricing explained, a cost calculator and a glossary.

> For the index of this section of the site, see [llms.txt](https://mastheadata.com/llms.txt)

BigQuery

# The BigQuery reference for data engineers

Practical answers for the BigQuery questions you search every week: how a function behaves, what an error means, and what a query or a table will cost. Written by the Masthead team, who monitor BigQuery jobs, pipelines and costs for data teams every day.

## Start here

*   [Data FinOps playbookHow BigQuery bills, how to attribute it to teams and pipelines, and the levers that cut it.](https://mastheadata.com/data-finops.md)
*   [Cost queriesReady-to-run SQL: most expensive queries, cost per user, dbt model and dashboard, unused tables.](https://mastheadata.com/bigquery/cost-queries.md)
*   [GA4 export queriesSessions, users, traffic, engagement and revenue from the GA4 export, runnable on Google's sample.](https://mastheadata.com/bigquery/ga4.md)
*   [Public datasetsWhat each public dataset holds, how big it is and what querying it costs.](https://mastheadata.com/bigquery/public-datasets.md)
*   [SQL functions143 functions with syntax, runnable examples, mistakes and cost notes.](https://mastheadata.com/bigquery/functions.md)
*   [Statements and clausesQUALIFY, PIVOT, MERGE, partitioning, clustering, scripting and INFORMATION\SCHEMA.](https://mastheadata.com/bigquery/sql.md)
*   [Error messagesWhat 51 common errors mean and how to fix them.](https://mastheadata.com/bigquery/errors.md)
*   [Pricing explainedOn-demand, editions, storage and every other line on the bill, with current list prices.](https://mastheadata.com/bigquery/pricing.md)
*   [Pricing calculatorOn-demand vs editions and logical vs physical storage, with your own numbers.](https://mastheadata.com/bigquery/pricing-calculator.md)
*   [GlossarySlots, reservations, editions, lineage, data contracts and more, defined plainly.](https://mastheadata.com/glossary.md)

## SQL reference by category

[Date functions (14)](https://mastheadata.com/bigquery/date-functions.md)[Datetime functions (8)](https://mastheadata.com/bigquery/datetime-functions.md)[Timestamp functions (12)](https://mastheadata.com/bigquery/timestamp-functions.md)[String functions (28)](https://mastheadata.com/bigquery/string-functions.md)[Aggregate functions (16)](https://mastheadata.com/bigquery/aggregate-functions.md)[Window functions (11)](https://mastheadata.com/bigquery/window-functions.md)[Array functions (11)](https://mastheadata.com/bigquery/array-functions.md)[JSON functions (14)](https://mastheadata.com/bigquery/json-functions.md)[Conversion functions (3)](https://mastheadata.com/bigquery/conversion-functions.md)[Conditional expressions (5)](https://mastheadata.com/bigquery/conditional-expressions.md)[Mathematical functions (15)](https://mastheadata.com/bigquery/math-functions.md)[Hash and utility functions (6)](https://mastheadata.com/bigquery/utility-functions.md)[Query syntax (11)](https://mastheadata.com/bigquery/query-syntax.md)[DDL statements (8)](https://mastheadata.com/bigquery/ddl.md)[DML statements (5)](https://mastheadata.com/bigquery/dml.md)[Scripting and data movement (5)](https://mastheadata.com/bigquery/scripting.md)[INFORMATION\SCHEMA (2)](https://mastheadata.com/bigquery/information-schema-views.md)

## Most looked-up

[UNNEST](https://mastheadata.com/bigquery/functions/unnest.md)[DATE\DIFF](https://mastheadata.com/bigquery/functions/date-diff.md)[QUALIFY](https://mastheadata.com/bigquery/sql/qualify.md)[DATE\TRUNC](https://mastheadata.com/bigquery/functions/date-trunc.md)[SPLIT](https://mastheadata.com/bigquery/functions/split.md)[JSON\EXTRACT\SCALAR](https://mastheadata.com/bigquery/functions/json-extract-scalar.md)[SAFE\CAST](https://mastheadata.com/bigquery/functions/safe-cast.md)[ROW\NUMBER](https://mastheadata.com/bigquery/functions/row-number.md)[STRING\AGG](https://mastheadata.com/bigquery/functions/string-agg.md)[MERGE](https://mastheadata.com/bigquery/sql/merge.md)[PIVOT](https://mastheadata.com/bigquery/sql/pivot.md)[REGEXP\EXTRACT](https://mastheadata.com/bigquery/functions/regexp-extract.md)[INFORMATION\SCHEMA.JOBS](https://mastheadata.com/bigquery/sql/information-schema-jobs.md)[PARTITION BY (partitioned tables)](https://mastheadata.com/bigquery/sql/partition-by.md)

## Common errors

[Resources exceeded during query execution](https://mastheadata.com/bigquery/errors/resources-exceeded-during-query-execution.md)[User does not have permission to query table, or perhaps it does not exist](https://mastheadata.com/bigquery/errors/access-denied-permission-to-query-table.md)[Dataset was not found in location](https://mastheadata.com/bigquery/errors/dataset-not-found-in-location.md)[Quota exceeded: free query bytes scanned](https://mastheadata.com/bigquery/errors/quota-exceeded-free-query-bytes.md)[Cannot query over table without a filter for partition elimination](https://mastheadata.com/bigquery/errors/cannot-query-without-partition-filter.md)[UPDATE/MERGE must match at most one source row for each target row](https://mastheadata.com/bigquery/errors/update-merge-must-match-at-most-one-source-row.md)

## BigQuery concepts

[Baseline slots](https://mastheadata.com/glossary/baseline-slots.md)[BI Engine](https://mastheadata.com/glossary/bi-engine.md)[BigQuery autoscaler](https://mastheadata.com/glossary/bigquery-autoscaler.md)[BigQuery editions](https://mastheadata.com/glossary/bigquery-editions.md)[BigQuery fluid scaling](https://mastheadata.com/glossary/fluid-scaling.md)[BigQuery on-demand pricing](https://mastheadata.com/glossary/on-demand-pricing.md)[BigQuery reservation](https://mastheadata.com/glossary/bigquery-reservation.md)[BigQuery slot](https://mastheadata.com/glossary/bigquery-slot.md)[Cloud Audit Logs for BigQuery](https://mastheadata.com/glossary/cloud-audit-logs.md)[Clustered table](https://mastheadata.com/glossary/clustered-table.md)[Idle slots](https://mastheadata.com/glossary/idle-slots.md)[Logical vs physical storage billing](https://mastheadata.com/glossary/storage-billing-model.md)

## Guides from the blog

*   [How BigQuery fluid autoscaling eliminates the scale-down latency taxIf you run BigQuery on GCP at scale, you are likely familiar with the challenge of capacity management. To keep query performance predictabl…](https://mastheadata.com/blog/how-bigquery-fluid-autoscaling-eliminates-the-scale-down-latency-tax.md)
*   [Mastering BigQuery Cost Optimization: Insights from a LinkedIn Live Deep DiveIn a recent LinkedIn Live session, Yuliia, CEO and co-founder of MastHead Data, talked about rising challenge facing data teams today: the r…](https://mastheadata.com/blog/mastering-bigquery-cost-optimization.md)
*   [Understanding and Managing Projects with Ad-Hoc Usage: A Better Fit for the BigQuery On-Demand Billing ModelBigQuery’s on-demand billing model offers a flexible and cost-effective solution for ad-hoc querying needs. However, understanding and manag…](https://mastheadata.com/blog/bigquery-ad-hoc-usage-projects.md)
*   [Navigating BigQuery Editions: A Guide to Choosing the Right PricingBigQuery Editions offer a flexible approach to data warehousing and analytics, catering to organizations of all sizes and with diverse workl…](https://mastheadata.com/blog/pricing-editions.md)
*   [Google BigQuery Compute Cost Optimization: Mastering Editions PricingThis article is part of BigQuery Cost Optimization Series. Here is a Previous Article about GBQ Storage Cost.](https://mastheadata.com/blog/google-bigquery-compute-cost-optimization.md)
*   [BigQuery Storage Cost Structure: A Deep Dive into OptimizationHere is our first article from the BigQuery Cost Optimisation series.](https://mastheadata.com/blog/bigquery-storage-cost-structure-a-deep-dive-into-optimization.md)