# Identifiers

## Introduction

Identifiers are used to select classes and properties in queries.

An identifier of a class or property name in Starcounter SQL is a sequence of upper and lower case letters between A and Z, digits, and underscores where the first character can't be a digit.

Querying a database class or property that doesn't follow these restrictions will throw a `SqlException`:

```csharp
[Database]
public class Päron {}

Db.SQL("SELECT p FROM Päron p"); // SqlException
```

## Casing

Since Starcounter SQL is case insensitive, identifiers that are equal except for different casing are regarded to be the same identifier. Starcounter will throw `ScErrTypeNameDuplicate (SCERR4078)` if it finds two database classes where only the casing differs and `ScErrFieldsDifferInCaseOnly (SCERR4261)` if there are two fields or properties in a database where only the casing is different.

## Qualifying Classes in Different Namespaces

Starcounter automatically creates a database schema from the class definitions in the application program code. Thus, you could have several classes with the same name but in different namespaces. As a consequence, in Starcounter SQL you qualify a class name by specifying its namespace, not by specifying a database name or schema name. See example query below.

```sql
SELECT m.MyProperty FROM MyCompany.MyApplication.MyModule.MyClass m
```

As long as the class name is unique you do not have to specify the namespace. See example query below. However, in SQL statements in programming code we strongly recommend you to qualify all class names so the SQL statements will be guaranteed to still be valid when you add new classes.

```sql
SELECT m.MyProperty FROM MyClass m
```

## Reserved Words

If you have some identifier in your database schema that conflicts with some\
[reserved words](/2.3.1/guides/sql/reserved-words.md) in Starcounter SQL, you can tell the SQL parser that the term should not be interpreted as the reserved word by putting it inside double quotes, as in query below.

```sql
SELECT n."Left", n."Right" FROM Node n
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.starcounter.io/2.3.1/guides/sql/identifiers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
