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

# NQL Reference

> Complete reference documentation for Narrative Query Language

NQL (Narrative Query Language) is a SQL-like language with extensions for data collaboration. This reference covers all syntax, types, functions, and operators supported by NQL.

<Note>
  Looking to learn NQL? Start with [NQL Design Philosophy](/concepts/nql/design-philosophy) for concepts or [Write Your First NQL Query](/getting-started/first-nql-query) for a hands-on tutorial.
</Note>

## SQL Commands

Write and execute queries and create stored datasets.

<CardGroup cols={2}>
  <Card title="SELECT" icon="magnifying-glass" href="/nql/commands/select">
    Retrieve data from datasets
  </Card>

  <Card title="CREATE MATERIALIZED VIEW" icon="layer-plus" href="/nql/commands/create-materialized-view">
    Create stored datasets from queries
  </Card>
</CardGroup>

<Card title="Query Templates" icon="code" href="/nql/commands/query-templates">
  Parameterized queries with placeholder syntax
</Card>

## Data Types

<Card title="Data Types" icon="shapes" href="/nql/data-types">
  Primitive types, complex types, type casting, and NULL handling
</Card>

## Operators

<Card title="Operators" icon="calculator" href="/nql/operators">
  Comparison, logical, arithmetic, string, and pattern matching operators
</Card>

## Functions

Built-in and Narrative-specific functions organized by category.

<CardGroup cols={3}>
  <Card title="String" icon="font" href="/nql/functions/string-functions">
    Text manipulation
  </Card>

  <Card title="Date & Time" icon="clock" href="/nql/functions/date-time-functions">
    Temporal operations
  </Card>

  <Card title="Numeric" icon="hashtag" href="/nql/functions/numeric-functions">
    Math and rounding
  </Card>

  <Card title="Aggregate" icon="chart-bar" href="/nql/functions/aggregate-functions">
    GROUP BY computations
  </Card>

  <Card title="Array & Map" icon="brackets-curly" href="/nql/functions/array-map-functions">
    Collection operations
  </Card>

  <Card title="Window" icon="window" href="/nql/functions/window-functions">
    Ranking and analytics
  </Card>

  <Card title="Geospatial" icon="map-location-dot" href="/nql/functions/geospatial-functions">
    Geographic calculations
  </Card>

  <Card title="Narrative" icon="gear" href="/nql/functions/narrative-functions">
    Platform-specific functions
  </Card>

  <Card title="Conditional" icon="code-branch" href="/nql/functions/conditional-functions">
    IF, COALESCE, NULLIF
  </Card>
</CardGroup>

## General Reference

<CardGroup cols={3}>
  <Card title="Syntax Overview" icon="code" href="/nql/general/syntax">
    Statement types and grammar
  </Card>

  <Card title="Explicit Columns" icon="list-check" href="/nql/general/explicit-columns">
    Why wildcards are not supported
  </Card>

  <Card title="Reserved Keywords" icon="lock" href="/nql/general/reserved-keywords">
    Keywords requiring quoting
  </Card>
</CardGroup>
