# Step 4

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

Using the "SQL Set Rewrite Parser" engine, SQL Simulator takes the SQL and rewrites it so that retrieves only the needed records from production and copies them to the simulated database.&#x20;

If there are any foreign key tables those tables will get populated automatically by the "SQL Set Rewrite Parser".

{% hint style="danger" %}
If you omit the where clause in your SQL then the entire table will be copied.
{% endhint %}


---

# 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://docs.tribalknowledge.tech/ratifier-tutorials/sql-simulator/technical-overview/step-4.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.
