A GoogleSQL script contains several statements separated by semicolons. Declare a variable before using it: DECLARE cutoff DATE DEFAULT DATE '2025-05-01';. Later statements can read cutoff wherever a scalar expression belongs. SET changes its value. Variables are useful when a report needs one agreed reporting window instead of several date literals that can drift apart.
Choose names that differ from column names. In BigQuery, a column takes precedence over a variable with the same name, which can silently change a filter. This console asks you to rename a conflicting variable, so use a name such as target_country. It supports scalar declarations, assignments and straight-line BEGIN ... END blocks. The production language also supports control flow and exception handlers; these exercises don't simulate those features. The result grid shows the final query, so place the report after the assignments.