Chapter 5. SQL Syntax

Table of Contents

5.1. Lexical Structure
5.1.1. Identifiers and Key Words
5.1.2. Constants
5.1.3. Operators
5.1.4. Special Characters
5.1.5. Comments
5.1.6. Operator Precedence
5.2. Value Expressions
5.2.1. Column References
5.2.2. Positional Parameters
5.2.3. Subscripts
5.2.4. Field Selection
5.2.5. Operator Invocations
5.2.6. Function Calls
5.2.7. Aggregate Expressions
5.2.8. Window Function Calls
5.2.9. Type Casts
5.2.10. Collation Expressions
5.2.11. Scalar Subqueries
5.2.12. Array Constructors
5.2.13. Row Constructors
5.2.14. User Variable
5.2.15. Expression Evaluation Rules
5.3. Calling Functions
5.3.1. Using Positional Notation
5.3.2. Using Named Notation
5.3.3. Using Mixed Notation

This chapter describes the syntax of SQL. It forms the foundation for understanding the following chapters which will go into detail about how SQL commands are applied to define and modify data.

We also advise users who are already familiar with SQL to read this chapter carefully because it contains several rules and concepts that are implemented inconsistently among SQL databases or that are specific to LightDB.