> For the complete documentation index, see [llms.txt](https://docs.getinfinity.app/user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getinfinity.app/user-guide/comprehensive-user-guide/2.-charts/creating-charts/data-explorer.md).

# Data Explorer

In this article, we will explain how to create and customize a line chart. So let's get started!

The **Data Explorer** in Infinity provides an advanced SQL-based interface for users who prefer to manually query datasets, customize visualizations, and leverage AI assistance for SQL generation. Follow these steps to build and analyze data using SQL.

***

### **Step 1: Access the Data Explorer**

1. Click on **"Data Explore"** from the left sidebar.

💡 *This opens the SQL based Data Explorer, where you can write queries and explore data.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FtoYM43s6JXG0APAgUyJd%2Fimage.png?alt=media&amp;token=0b893305-b6d6-4f5e-9e66-a6990a487717" alt=""><figcaption></figcaption></figure>

***

### **Step 2: Add a New Query**

1. Click **"Add New Query"** to create a new query workspace.
2. A new query editor box will appear.

📌 *Each query box is independent, allowing multiple datasets to be built simultaneously.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FA0LTh4S6hPyKY0yIMEIA%2Fimage.png?alt=media&amp;token=90be932e-9871-47d2-b0ea-1337339a0536" alt=""><figcaption></figcaption></figure>

***

### **Step 3: Select the Relevant Data Source**

1. Choose the appropriate **database or uploaded dataset** from the available options.

🔍 *Ensure you select the correct source before running queries to avoid errors.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2Fqo6mecmfEfmNKWOc17CT%2Fimage.png?alt=media&amp;token=778c5fc6-a5a3-42be-86f8-cde67d90be58" alt=""><figcaption></figcaption></figure>

***

### **Step 4: Write the SQL Query to Build a Dataset**

1. In the query editor, enter your SQL query.
   * Example:

     ```sql
      SELECT sales, orderdate FROM orders;
     ```
2. Modify the query based on the dataset requirements.

🛠️ *This step allows full control over how the dataset is structured.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FvQVQBHYzQ38KcSPOmeE6%2Fimage.png?alt=media&amp;token=92e9b7b7-d707-4e5c-86d4-dd8ce09c7af4" alt=""><figcaption></figcaption></figure>

***

### **Step 5: Click "EXECUTE" to Run the Query**

1. Once the query is written, click **"EXECUTE"** to run it.
2. The results will be displayed in a table format below the query box.

📊 *Executing the query fetches the relevant data for visualization.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FAX080KIQe5PH8wNWlokX%2Fimage.png?alt=media&amp;token=61ab6f05-754c-41ab-94d9-fb8e7fad7de6" alt=""><figcaption></figcaption></figure>

***

### **Step 6: Use AI Bot for SQL Assistance**

1. Click on the **AI Bot** feature to get SQL assistance.
2. AI can **suggest, auto-fix, or optimize** your SQL query.

🔹 *Helpful for users who are unsure about SQL syntax or need optimization suggestions.*\
![](https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FiPmGT2DgWd2IqSCTOh0l%2Fimage.png?alt=media\&token=96bf4401-d8f5-4691-8e13-dfffe034215a)

***

### **Step 7: Automatically Fix Query Syntax Errors**

1. If your query has errors, AI will suggest corrections.
2. Click **"Apply Fix"** to correct syntax issues automatically.

🛠️ *This ensures that queries run without manual troubleshooting.*<br>

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FdSJ5BCOAkDWtCojSDGsr%2Fimage.png?alt=media&amp;token=48a9502f-5548-4f92-8d0f-5e37e597e214" alt=""><figcaption></figcaption></figure>

***

### **Step 8: Click "EXECUTE" Again**

1. If the query was fixed or modified, click **"EXECUTE"** again to retrieve updated results.

🔄 *Re-executing the query applies changes and fetches fresh data.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FUyu7Cwbc7wot2ZNFN9lq%2Fimage.png?alt=media&amp;token=202774f5-d17e-4395-aa1b-11d73f8f7c8c" alt=""><figcaption></figcaption></figure>

***

### **Step 9: Use AI to Generate a Visualization from the Dataset**

1. Click on **"Visualization"** to let AI suggest a suitable chart for the dataset.
2. The system will automatically determine the best **chart type, layout, and formatting**.

📌 *AI-driven visualizations help quickly convert raw data into meaningful insights.*<br>

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FIFe06Mxr3NpRi66no1l2%2Fimage.png?alt=media&amp;token=deb2e9da-541b-44e8-bfba-6457f7131efe" alt=""><figcaption></figcaption></figure>

***

### **Step 10: Customize the Table and Chart**

1. Click **"Customize the Table"** to manually format/create the chart.
2. The user will be taken to the chart customization page.

🎨 *This step allows users to create and refine the chart before saving it.*

<figure><img src="https://2441185785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeTNY9XuZbora2UmeM4sm%2Fuploads%2FRI6YjfanbqSf6jgPp1oY%2Fimage.png?alt=media&amp;token=c286717d-8404-4d23-8ef9-23d99fe5c31a" alt=""><figcaption></figcaption></figure>

***

### **Final Step: Save the Chart**

1. Once the visualization is complete, click **"Save"** to store it.
2. The chart will be available in your **feed**.

💾 *Your SQL-powered chart is now ready for sharing and further analysis!*

***

### **Next Steps**

For more advanced customization, refer to the [**Chart Customization Guide**](/user-guide/comprehensive-user-guide/2.-charts/chart-customization.md) to explore:

* **Using interactive filters and drill-downs**.
* **Applying custom themes and layouts**.
* **Integrating AI-powered insights into reports**.

The **Data Explorer** in Infinity provides **full SQL control, AI assistance, and powerful visualization tools**, making it an ideal solution for **data analysts, engineers, and SQL-savvy users**. 🚀
