> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Keywords & Identifiers

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

SQL statements consist of two fundamental components:

* [**Keywords**](#keywords): Words with specific meaning in SQL like `CREATE`, `INDEX`, and `BOOL`
* [**Identifiers**](#identifiers): Names for things like databases and some functions

## Keywords

Keywords make up SQL's vocabulary and can have specific meaning in statements. Each SQL keyword that CockroachDB supports is on one of four lists:

* <InternalLink path="sql-grammar">Reserved Keywords</InternalLink>
* <InternalLink path="sql-grammar">Type Function Name Keywords</InternalLink>
* <InternalLink path="sql-grammar">Column Name Keywords</InternalLink>
* <InternalLink path="sql-grammar">Unreserved Keywords</InternalLink>

Reserved keywords have fixed meanings and are not typically allowed as identifiers. All other types of keywords are considered non-reserved; they have special meanings in certain contexts and can be used as identifiers in other contexts.

### Keyword uses

Most users asking about keywords want to know more about them in terms of:

* **Names of objects**, covered on this page in [Identifiers](#identifiers)
* **Syntax**, covered in our pages <InternalLink path="sql-statements">SQL Statements</InternalLink> and <InternalLink path="sql-grammar">SQL Grammar</InternalLink>

## Identifiers

Identifiers are most commonly used as names of objects like databases, tables, or columns — because of this, the terms "name" and "identifier" are often used interchangeably. However, identifiers also have less-common uses, such as changing column labels with `SELECT`.

### Rules for Identifiers

In our <InternalLink path="sql-grammar">SQL grammar</InternalLink>, all values that accept an `identifier` must:

* Begin with a Unicode letter or an underscore (\_). Subsequent characters can be letters, underscores, digits (0-9), or dollar signs (\$).
* Not equal any [SQL keyword](#keywords) unless the keyword is accepted by the element's syntax. For example, <InternalLink path="sql-grammar">`name`</InternalLink> accepts Unreserved or Column Name keywords.

To bypass either of these rules, simply surround the identifier with double-quotes ("). You can also use double-quotes to preserve case-sensitivity in database, table, view, and column names. However, all references to such identifiers must also include double-quotes.

<Note>
  Some statements have additional requirements for identifiers. For example, each table in a database must have a unique name. These requirements are documented on each statement's page.
</Note>

## See also

* <InternalLink path="sql-statements">SQL Statements</InternalLink>
* <InternalLink path="sql-grammar">Full SQL Grammar</InternalLink>
* <InternalLink path="sql-name-resolution">SQL Name Resolution</InternalLink>
