SQL Assist

Prev Next

Overview

SQL Assist transforms the way users interact with databases by leveraging conversational AI to streamline SQL query creation and optimization. Designed to interpret natural language instructions and understand database schemas, SQL Assist delivers precise, context-aware SQL queries and clear, user-friendly explanations.

Key Features

  • Interactive SQL Query Generation: Generate syntactically correct SQL queries simply by describing your intent in natural language.

  • Query Optimization: Receive suggestions to enhance the performance of existing queries.

  • Conversational Interface: Understand complex SQL concepts through clear, conversational explanations tailored to your level of expertise.

  • Database Schema Support: Receive accurate schema-aware responses that reference the query from the current tab and from valid tables, columns, views, and other database objects.

  • Multi-Database Compatibility: Seamlessly supports multiple database systems including, but not limited to PostgreSQL, SQL Server, and SAP HANA.

  • Conversation History: Maintain context and continuity across multiple interactions for a smooth and efficient development experience.

Note

To use SQL Assist, AI features must be enabled for your tenant. Contact your Administrator to enable AI features.

Data Security and Privacy

Only the information necessary for generating or optimizing queries (such as user input or schema metadata) is processed. SQL Assist does not access or store actual database records or user data beyond what is explicitly provided in the query context.

Conversation histories are stored securely in the database and are isolated per user and tenant.

Important!

  • Your conversations and any data you provide as context (such as database schemas or queries) are used by SQL Assist solely to process your current prompt and generate a relevant response.

  • Prompts, responses, and data accessed through SQL Assist aren't used to train the underlying AI model.

Chat Retention Policy

Chats are saved in the database until you delete them manually. SQL Assist retains a chat for 96 hours (4 days) from the time of the last message. The expiration time is displayed next to the Auto-apply changes text box.

Once a chat expires, input is disabled, but the chat remains visible on the Chats list until you delete it manually. When you delete a chat, it is removed permanently and cannot be recovered. This action is immediate.

For more information on managing chats, refer to the Manage Chats section.

What SQL Assist Can Do

SQL Assist allows you to both understand and create SQL code through natural language interaction. It explains existing SQL statements in clear, accessible terms by analyzing query logic, join conditions, data flow, and performance considerations. Whether you're trying to understand how a complex query works, debugging an erroneous DDL, or identifying optimization opportunities, SQL Assist provides actionable insights tailored to your context.

Creating new SQL queries is as simple as describing your data needs. SQL Assist can generate everything from basic SELECT statements with complex JOINS to advanced data transformation queries, and DDL scripts for reporting or ETL tasks with the given schema context.

When working with existing code, it can modify queries based on your specifications, whether you need to adjust filtering conditions, add or remove columns, refine join logic, or optimize query performance for efficiency. You can ask questions like:

  • Explain this query's performance impact

  • Create a query to show monthly sales by region

  • Add a filter for active customers only

  • Optimize this query for better performance

Refer to SQL Assist Best Practices for more information on how to use SQL Assist effectively.

Note

SQL Assist is not designed to respond to prompts unrelated to SQL queries, database operations, and query analysis.

Access SQL Assist

The SQL Assist is available in the Insights panel. Click the SQL Assist tab to access the chat window. When you access SQL Assist for the first time in a session, a new chat is displayed by default.

Converse with SQL Assist

Use the SQL Assist’s chat window to interact with SQL Assist in natural language. You can ask SQL Assist questions specific to a datastore, or get assistance writing or editing SQL queries.

In the chat window, you can set the context for the question you ask. The context can be based on the current query on the tab or the context set using the Select Schema Objects dialog box. SQL Assist generates tailored responses based on the context and the question you ask.

Note

Context are set per chat and stored in the chat history.

Add Schema Context

If you open SQL Assist for the first time in a session, it is connected to the current query tab by default, but not to any datastore. However, you can still ask general questions about SQL.

You can set context to your datastore objects in the current tab by accessing a datastore and selecting an available operation on a particular object. Alternatively, you can enter a query and ask SQL Assist a specific question about it.

Select Schema Objects

In addition to using the query in the current tab as context, you can also set specific schema objects from the datastore as context. Click the Select Schema Objects button to open the Select Schema Objects dialog box, where you can search for and add objects to set context for the current chat window. The selected schema objects will appear above the search bar.

Currently the following objects are displayed in the Select Schema Objects dialog box:

  • Tables

  • Views

  • Functions

The Select Schema Objects button displays the number of objects currently set as context.

When you hover over this button, a tooltip will appear displaying the objects you have selected.

To remove an selected object, you can either uncheck the object from the list below the search bar or click the Cancel (X) button next to the required object.

Auto-Apply Query Changes

With the Auto-Apply Changes feature, you can choose to apply SQL Assist’s suggestions automatically using the checkbox or review and apply them manually using the Auto-Apply Changes button from the response. Additionally, you can also copy the suggested SQL command to the clipboard.

Note

Changes will be applied to the query tab that is currently open.

Changes made to the query using the Auto-Apply Changes checkbox or button will be saved in the History tab for future reference. Users can easily revert to a previous script if they are not satisfied with the AI-generated response.

Important!

SQL Assist only applies script modifications; query execution remains a manual action to ensure strict control and prevent unauthorized operations.

Submit Your Question

To submit a question or prompt, enter it in the prompt box and click the Send icon or press Enter. The submitted prompt appears in the chat window. Once the response is ready, it appears below the prompt along with the selected schema context information.

Manage Chats

You can manage multiple conversations simultaneously by creating separate chats for different tasks or queries. You can do the following actions in the chat window:

  • View Previous Chats: SQL Assist stores chat histories securely in the database. Select the Chats list to view previous conversations.

  • Create New Chats: Create multiple chat windows at any time using the Add (+) button next to the Chats list.

  • Clear Messages: Click the Clear Messages icon to remove all messages in your chat and free up space. This action helps clean up your chat history and ensures a fresh start for new conversations.

  • Delete a Chat: Delete chats that are no longer needed. Select a previous chat from the Chats list and click the Delete icon.

Related Articles