Generate queries

Generate SQL or Salesforce Object Query Language queries with Snap GPT.

SnapGPT can generate SQL or Salesforce Object Query Language (SOQL) queries from natural language prompts using the LLMs. Environment admins configure whether SnapGPT can read endpoint schemas to generate accurate more accurate queries. Otherwise, you need to adjust the table and column names to match your endpoint.

A Private Snap Pack for MySQL supports accurate schema reading for SnapGPT. Consult your CSM to learn more.

Generate an SQL query

Follow these steps to generate an SQL query:

  1. In Designer, open a pipeline that contains an SQL Snap.
  2. In SnapGPT, enter Generate SQL in the prompt. SnapGTP asks you to select an SQL Snap.
  3. Click the Snap to open it. For this example, we'll use an Azure SQL Execute Snap.
  4. In SnapGPT, enter your prompt. For this example, we'll use: Retrieve all customers acquired in the last 30 days. The SnapGPT SQL Preview window opens:
    SnapGPT Preview window

  5. Check the statement and edit it if necessary.
  6. Click Apply to Snap.
  7. Save the Snap and validate the pipeline.