> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/wemreference/sql-compatibility.md).

# SQL Compatibility

When writing expressions in WEM to filter data or loop through lists to make changes, some parts of these expressions may be SQL Compatible - which means that these parts of the expression can be transformed to native SQL statements or they can be handled as static values, and the database server can work with it directly. ***This is the optimal situation.***\
When expressions are NOT SQL Compatible, this means that more rows and data need to be retrieved from the database and the expression needs to be executed in memory. It can even need more than one database queries to be handled. \
So, when accessing data in the database using filters or loops, it will be useful to know a bit about the SQL Compatibility of your expressions.

In this section we provide the SQL Compatibility information on Functions, Keyword and Operators in the WEM Expression language.

{% content-ref url="/pages/2acCaYnSbf6N48xWrhaF" %}
[Functions](/platform/wemreference/sql-compatibility/functions.md)
{% endcontent-ref %}

{% content-ref url="/pages/X5gyHvsoKI1kSv4EMqWn" %}
[Keywords](/platform/wemreference/sql-compatibility/keywords.md)
{% endcontent-ref %}

{% content-ref url="/pages/Yv1bMWRFNGLzvaEc3YyF" %}
[Operators](/platform/wemreference/sql-compatibility/operators.md)
{% endcontent-ref %}


---

# 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.wem.io/platform/wemreference/sql-compatibility.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.
