Statement types
NQL supports two main statement types:Query Templates
NQL also supports parameterized queries through query templates, which use placeholder syntax to create reusable, customizable queries.Key syntax rules
- Explicit columns required: NQL does not support
SELECT *orCOUNT(*). See Explicit Column Selection. - Reserved keywords: Certain keywords must be quoted when used as identifiers. See Reserved Keywords.
- Fully qualified names: Use fully qualified column names (e.g.,
company_data."123".column_nameorcompany_data.my_dataset.column_name) to avoid ambiguity, especially in joins. - Dataset references: Reference a dataset in the
company_dataschema by its numeric ID (company_data."123") or its name (company_data.my_dataset). Numeric IDs must be quoted because they’re numeric; names need quoting only when they’re a reserved keyword or contain special characters. See NQL vs. SQL for when each form is used and why.
Related content
SELECT
Full SELECT statement syntax and clauses
Data Types
Primitive and complex types supported in NQL
Operators
Comparison, logical, and arithmetic operators
Functions
Built-in and Narrative-specific functions
NQL vs. SQL
How NQL differs from standard SQL, including dataset references

