> For the complete documentation index, see [llms.txt](https://docs.duql.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duql.dev/language-comparisons/vs-prql.md).

# DUQL vs PRQL

DUQL is a powerful, YAML-based query language that builds upon the strengths of PRQL (Pipelined Relational Query Language) while offering enhanced readability, flexibility, and ease of use. This document aims to provide a detailed comparison between DUQL and PRQL, highlighting the key differences and advantages of DUQL.

## Terminology Mapping

| PRQL Term   | DUQL Term   | Description                                          |
| ----------- | ----------- | ---------------------------------------------------- |
| `from`      | `dataset`   | Specifies the data source                            |
| `select`    | `select`    | Chooses columns to include in the output             |
| `filter`    | `filter`    | Selects rows based on conditions                     |
| `derive`    | `generate`  | Creates new columns or modifies existing ones        |
| `group`     | `group`     | Groups by 1 or more columns                          |
| `aggregate` | `summarize` | Performs aggregation operations                      |
| `sort`      | `sort`      | Orders the results                                   |
| `take`      | `take`      | Limits the number of rows returned                   |
| `join`      | `join`      | Combines data from multiple sources                  |
| `window`    | `window`    | Performs calculations across a set of rows           |
| `let`       | `declare`   | Defines variables, functions, or reusable components |

## Key Advantages of DUQL over PRQL

1. **YAML-based Syntax**: DUQL uses YAML, a human-friendly data serialization standard, making queries more readable and easier to write, especially for complex operations.
2. **Enhanced Readability**: The structure of DUQL queries is more intuitive, with clear separation between different operations and improved formatting options.
3. **Simple Naming Conventions**: DUQL uses intuitive naming conventions across its functions and operations that assist with understanding for users new to querying data.
4. **JSON Schemas**: DUQL has well-defined JSON schema definitions for query structure and transforms, simplifying the creation of 'query builder' interfaces.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.duql.dev/language-comparisons/vs-prql.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.
