# SQL Builder

**SQL Builder** is a designer tool provided by ONEWEB that allows users to **create SQL queries without writing SQL syntax manually**.\
Instead of coding, users can build queries by **selecting tables and columns directly from the ER Diagram** designed in **Data Designer**.

This visual approach makes database querying accessible to both developers and non‑SQL users in a low‑code environment.

***

#### **Purpose of SQL Builder**

SQL Builder is designed to:

* Generate SQL queries without requiring SQL knowledge
* Reduce errors caused by manual query writing
* Speed up query creation during development
* Ensure consistency between database schema and queries

By relying on the ER Diagram as its foundation, SQL Builder ensures that queries are always aligned with the current data model.

***

#### **Dependency on ER Diagram**

SQL Builder is **ER Diagram–driven**.\
Before using SQL Builder, users must first create a valid data model using **Data Designer**.

This can be done in two ways:

* **Design the schema from scratch** using Data Designer
* **Import an existing database schema** into the ER Diagram Designer

Only after the ER Diagram is available can SQL Builder be used to construct queries.

***

#### **Building SQL Queries Visually**

Once a valid ER Diagram is in place, users can start building SQL queries by:

* Selecting tables from the ER Diagram
* Choosing columns to include in the query
* Defining joins based on existing relationships
* Applying conditions, filters, and query logic visually

SQL Builder automatically translates these selections into valid SQL statements.

***

#### **Role of SQL Builder in Low‑Code Development**

Within **Low‑Code with AppSpace**, SQL Builder plays an important role by:

* Bridging data modeling and data access
* Allowing faster prototyping and development
* Reducing dependency on database specialists
* Integrating seamlessly with other Database Tools

It is commonly used alongside:

* **Data Designer** (for schema design)
* **Data Viewer** (for inspecting tables and data)
* Application components such as Processes and Microflows

***

#### **Summary**

**SQL Builder** simplifies SQL creation by providing a **visual, schema‑driven query designer**.

With SQL Builder, users can:

* Build SQL queries without SQL syntax knowledge
* Leverage ER Diagrams as the source of truth
* Maintain alignment between data models and queries
* Accelerate low‑code application development

As part of ONEWEB’s **Database Tools**, SQL Builder enables efficient, consistent, and low‑risk database querying within AppSpace.


---

# 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.onewebstack.com/oneweb-platform-th/designer-reference/data-designer/sql-builder.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.
