I found the list of reserved keywords for Standard SQL, at Standard SQL Lexical Structure - Lexical Structure - Reserved Keywords.
But I can't find the equivalent list for Legacy SQL, although there is a reference to it at Legacy SQL Functions and Operators - Query Syntax - SELECT Clause:
You can use square brackets to escape reserved words so that you can use them as field name and aliases. For example, if you have a column named "prefix", which is a reserved word in BigQuery syntax, the queries referencing that field will fail with obscure error messages unless you escape it with square brackets
I know some of the keywords are different; for example Legacy SQL has FLATTEN
which I assume is reserved, which Standard SQL does not.
Any pointers would help.