Last modified on 2 January 2014, at 12:36

SQL Dialects Reference/Data structure definition/Delimited identifiers

Delimited identifiersEdit

There are regular identifiers and delimited identifiers to denominate database objects like tables or columns. You must apply delimited identifiers if you want to use SQL keywords like 'FROM' as identifiers or special characters within its name. Delimited identifiers are labeled by the following techniques.

Dialect Sample Comment
Standard "identifier" The SQL standard calls these "delimited identifiers". The SQL standard requires that delimited identifiers are case-sensitive, although not all servers enforce this.
DB2 "identifier" Case sensitive per standard and also allows special characters
Firebird "identifier" Case sensitive per standard
Ingres "identifier" Case sensitivity for delimited identifiers is specified when a database is created. For compliance with ANSI/ISO Entry SQL-92, delimited identifiers must be case sensitive.
MonetDB "identifier" Case sensitive per standard
MSSQL [identifier]
"identifier"[1]
Case sensitivity is set by a per-database option.
MySQL `identifier`
"identifier"[2]
Oracle "identifier" Oracle's delimited identifiers are case-sensitive. Regular identifiers are case-insensitive. They are converted to uppercase before the execution of any statement, e.g: 'CREATE TABLE MyTable' is converted to 'CREATE TABLE MYTABLE' and 'SELECT * FROM mytable' to 'SELECT * FROM MYTABLE'. Therefore regular identifiers matches independent from their spelling.
PostgreSQL "identifier" Case sensitive per standard, or case insensitive without escaping (folded to lowercase not per standard)
SQLite [identifier]
"identifier"
'identifier'
identifier
Bracketed keywords are always understood as identifiers. Double-quoted keywords are understood as identifiers if previously seen as such, but are otherwise interpreted as string literals. Single-quoted keywords are interpreted as string literals where such are allowed, but otherwise as identifiers. Some keywords may be used as identifiers even when not quoted.
Virtuoso "identifier"  
Linter "identifier" Case sensitive per standard

Notes:

  1. If the quoted_identifier option is set on — otherwise, "identifier" would be parsed as a string in single quotes
  2. If running in ANSI mode.