# SQL Recipe Book

<figure><img src="/files/Zs0U37Q1Y8A2Ok1zcYl2" alt=""><figcaption></figcaption></figure>

Ready-made SQL query templates for common analytical tasks and industry-specific use cases in the **Navixy IoT Query**. Each recipe provides complete, functional SQL code that you can customize and execute directly against your data warehouse instance.

### What you'll find

**Complete SQL templates** with business context, parameter guidance, and optimization tips for the most frequent fleet management and telematics analytical challenges. All queries work with standard **IoT Query** schema structures and are optimized for PostgreSQL environments.

The queries in this book work for both dashboard panels and reports. When adapting a recipe for a report, include all columns needed across the data table, chart, and location map in a single query. See [Creating reports](/docs/analytics/dashboard-studio/creating-reports.md) for column requirements per component.

{% hint style="warning" %}
Enable **IoT Query** before utilizing data for building comprehensive analytics. If you don't have it yet, contact us for activation details - <iotquery@navixy.com>
{% endhint %}

### Navigation

* [**Common queries**](/docs/analytics/example-queries/common-queries.md) - Essential SQL templates for everyday fleet management tasks, including device status, user activity, location analysis, and basic reporting functions.
* [**Logistics**](/docs/analytics/example-queries/logistics.md) - Transportation and supply chain queries covering route optimization, cargo monitoring, fleet utilization, compliance tracking, and delivery performance analytics.
* [**Leasing**](/docs/analytics/example-queries/leasing.md) - Banking and leasing templates for asset lifecycle management, contract compliance, maintenance scheduling, usage limit enforcement, and risk assessment workflows.

### Request additional recipes

**Need a recipe not in our collection?** Use the feedback feature (click the feedback emoji below) to request new SQL templates. Include your analytical requirement, industry context, and desired output.

**Have a proven template to share?** Click "Edit on GitHub" on any recipe page to contribute directly through our repository.

### Support

For technical assistance with SQL implementation or **IoT Query** connectivity, contact support at <support@navixy.com> with your specific query requirements and system configuration details.


---

# Agent Instructions: 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://navixy.com/docs/analytics/example-queries.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.
