What is the difference between Standard SQL and Legacy SQL in BigQuery?

Quick Overview

Asks how the GoogleSQL (Standard SQL) dialect in BigQuery differs from Legacy SQL. It tests knowledge of feature support, syntax differences such as table references and comma joins, and how to switch dialects or migrate old queries safely.

What is the difference between Standard SQL and Legacy SQL in BigQuery?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

What is the difference between Standard SQL and Legacy SQL in BigQuery? ```hint Where to look Think about which statements each dialect can run (DML, DDL, scripting), how a table is referenced in each, and what happens to queries and views written in the older one. ``` ### What a Strong Answer Covers - Which dialect is current and the default, and which is deprecated - Feature gaps between the two, such as DML, DDL, scripting and `ARRAY`/`STRUCT` handling - Concrete syntax differences, including table references and what a comma between tables means - How to choose or switch the dialect for a query - What to watch for when migrating old legacy queries ### Follow-up Questions - How would you rewrite a legacy query that uses `TABLE_DATE_RANGE` over daily tables in GoogleSQL? - A legacy query and its GoogleSQL rewrite return different distinct counts. What could explain it? - How do repeated fields behave in each dialect, and how do you flatten them in GoogleSQL? - Can a GoogleSQL query read a view that was defined in legacy SQL?

Overview: Asks how the GoogleSQL (Standard SQL) dialect in BigQuery differs from Legacy SQL. It tests knowledge of feature support, syntax differences such as table references and comma joins, and how to switch dialects or migrate old queries safely.

General logo
General
Nov 24, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

What is the difference between Standard SQL and Legacy SQL in BigQuery?

What a Strong Answer Covers Guidance

  • Which dialect is current and the default, and which is deprecated
  • Feature gaps between the two, such as DML, DDL, scripting and ARRAY / STRUCT handling
  • Concrete syntax differences, including table references and what a comma between tables means
  • How to choose or switch the dialect for a query
  • What to watch for when migrating old legacy queries

Follow-up Questions Guidance

  • How would you rewrite a legacy query that uses TABLE_DATE_RANGE over daily tables in GoogleSQL?
  • A legacy query and its GoogleSQL rewrite return different distinct counts. What could explain it?
  • How do repeated fields behave in each dialect, and how do you flatten them in GoogleSQL?
  • Can a GoogleSQL query read a view that was defined in legacy SQL?