Supabind

AI SQL Assistant

Ask questions about your data in plain English and the assistant writes the SQL for you-right inside the Data Preview panel, using the file you already have open.

Overview

Open any file in the Data Preview workspace and click AI SQL Assistant in the toolbar to bring up a prompt box. Describe what you want in plain language-for example, "Show me the top 10 products by sales"-and the assistant generates a SQL query against the table you have open. You can either create a brand new table from the result or modify the one you're currently viewing.

Open the AI SQL Assistant

The assistant lives in the same toolbar as Apply Template and Charts, so it's always one click away while you're reviewing a file.

Data preview
Apply TemplateCharts AI SQL Assistant
Clicking the button opens a floating prompt panel on top of the current table, listing that table as an available source.

Steps

  1. Open a file in the Data Preview workspace.
  2. Click AI SQL Assistant in the toolbar, next to Charts.
  3. The prompt panel opens with your current file listed under Available Tables.

Create New vs Modify Current

Before you write a prompt, choose whether the result should become a separate table or update the one you're already viewing.

Choose a mode

Create New
Modify Current
Create New keeps your original file untouched and adds a new table with the query result. Modify Current applies the query directly to the table you have open.

If you're not sure which to pick, start with Create New. You can always delete the extra table afterward, but Modify Current changes your working table right away.

Choose a Model

The model selector in the top-right of the assistant panel controls which AI model generates the SQL for you.

Steps

  1. Click the model dropdown in the top-right of the AI SQL Assistant panel.
  2. Select the provider and model you want to use.
  3. Your choice is remembered for future queries in this session.

If a generated query doesn't look right, try switching models before rewriting your prompt-different models can interpret the same request differently.

Generate a Query

Type your request in the prompt box and click Generate to turn it into SQL.

Ask me to generate SQL queries... (e.g., 'Show me the top 10 products by sales')
Generate

Steps

  1. Type your request in plain language, including any grouping, filtering, or ordering you want.
  2. Click Generate.
  3. Review the SQL and resulting table in the Data Preview.
  4. If it's not quite right, adjust your prompt and generate again.

Working with Available Tables

The assistant only queries tables listed under Available Tables at the bottom of the panel-usually the file you currently have open.

Available Tables

dummy_product_data_500

Steps

  1. Check Available Tables before writing a prompt, so you know which table names the assistant can reference.
  2. Mention the table by name in your prompt if you have more than one open, to avoid ambiguity.
  3. Add more files from the Tables panel on the right if you need to query across additional sources.

Was this article helpful?

Need More Help?

If you need help writing prompts, choosing a model, or troubleshooting a generated query, our support team is here to help.

Contact Support