Identifiers are used when referencing database objects.
Identifiers in a SQL query are case-insensitive.
All of the following queries behave exactly the same:
SELECT * FROM CITIES;
SELECT * FROM cities;
SELECT * FROM Cities;
Identifiers wrapped in a double quote ("
) retain their original casing.
Both of these queries are referencing different tables:
SELECT * FROM "Cities";
SELECT * FROM cities;
Case-insensitivity applies to all database objects, including functions.
Both queries are equivalent:
SELECT abs(-1.0);
SELECT ABS(-1.0);
When querying columns, unquoted identifiers match column names ignoring case.
For example, if we have a parquet file with columns EmployeeName
and
Department
, all of the below queries behave the same:
SELECT EmployeeName, Department FROM './employees.parquet';
SELECT employeename, department FROM './employees.parquet';
SELECT "EmployeeName", "Department" FROM './employees.parquet';
Note that quoting a column name forces case sensitive matching. Using the same parquet example, the below query will error:
-- Error: Missing column for reference: employeename
SELECT "employeename", "department" FROM './employees.parquet';
When no explicit alias is provided for an expression in the SELECT
list, an
column name will be generated using the following rules:
?column?
is used.