Skip to main content
NQL (Narrative Query Language) uses SQL-like syntax with extensions for data collaboration. This page provides a high-level overview of statement types and links to detailed references.

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 * or COUNT(*). 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_name or company_data.my_dataset.column_name) to avoid ambiguity, especially in joins.
  • Dataset references: Reference a dataset in the company_data schema 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.

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