Skip to content

AIV SQL Buddy

AIV SQL Buddy is an intelligent SQL generation tool that converts natural language queries (NLP) queries into SQL statements. This tool is designed to assist users in writing SQL queries with ease by translating their plain English requests into accurate SQL queries. It also allows users to build on previous queries if the context is related and offers advanced options for table selection and context management.

Key Features

  1. Table and View Selection: Before writing SQL queries, you can select the specific table or view on which you want to execute the query. This ensures that AIV SQL Buddy generates queries tailored to the selected database objects.

    Image

  2. Natural Language to SQL Conversion: Simply input a plain English request, and AIV SQL Buddy will generate the corresponding SQL query.

    Image

  3. Contextual Query Expansion: If the next query is related to the previous one, AIV SQL Buddy will intelligently expand the SQL query to include the new conditions.

    Image

    Example:

    • Tables Used: InsuranceData
    • Input 1: “Display the names of the policyholders.”
    • Output 1:
      SELECT `Policyholder Name` FROM InsuranceData
    • Input 2: “Show the premium amounts.”
    • Output 2:
      SELECT `Policyholder Name`, `Premium Amount` FROM InsuranceData
    • Input 3: “Show the policy number and policy type where the premium amount is greater than 800.”
    • Output 3:
      SELECT `Policyholder Name`, `Premium Amount`, `Policy Number`, `Policy Type` FROM InsuranceData WHERE `Premium Amount` > 800
  4. Initiate New Chat: If you want to start a new conversation or create a completely new SQL query without reference to previous queries, you can use the “Initiate New Chat” feature. This clears the current context and starts a fresh session.

    • Step 1: Click “Initiate New Chat.”

    • Step 2: Input a new query, and AIV SQL Buddy will treat it as a new request.

      Image

  5. Query History: AIV SQL Buddy maintains a history of queries and responses. Users can review previous queries and outputs, facilitating the building upon or refining of past queries. This history is useful for tracking workflow and making iterative improvements to SQL statements. Additionally, users can rename or delete entries in the query history to better manage and organize their workflow.

    Image

  6. Copy Results: The results of generated SQL queries can be easily copied to the clipboard for use in other applications or for further processing. This feature allows users to quickly transfer the SQL output or results into their preferred SQL client or documentation.

    Image

  7. Publish Results: The result can be pushed directly from AI Buddy to Dataset SQL textarea by clicking on the publish button.

    Image

  8. Speech to Text: Users can convert spoken language into queries. Simply speak the desired query, and AIV SQL Buddy will transcribe the speech into text and generate the corresponding SQL query. This feature provides a hands-free way to create SQL statements and enhances accessibility.

    Image

Steps to Utilize the AIV SQL Buddy:

  1. Go to the hamburger menu, navigate to the Master Data section, and click the Datasets tab. The Datasets page will appear. Then, click the Create Dataset button in the bottom toolbar.

    Image

  2. When you click the Create Dataset button, a Create Dataset dialog box will appear.

    Image

  3. Enter a Name for the dataset (e.g., Insurance). In the General tab, select the Datasource and Source. For example, choose JDBC as the datasource and Insurance as the source. Once the source is selected, click on the AIV SQL Buddy button.

    Image

  4. When you click the AIV SQL Buddy button, an AIV SQL Buddy dialog box will appear. In this dialog box, select the desired table (e.g., InsuranceData) from the dropdown menu as per your requirement.

    Image

  1. Write your query in the Input box (e.g., Show top 10 policyholders based on total premium collected.).

  2. After entering the query, click the generate icon button to execute the process, and the results will be displayed.

    Image

  3. If you write another query (e.g., Show all policies where total premium > 500.), it will automatically merge with the existing query to further refine the results.

    Image

  1. Once the query is generated, copy and paste it into the Dataset Query box. Click Preview to check if the query works correctly, and after verification, click the CREATE.

    Image

  2. As you click the CREATE button, a confirmation message will appear, indicating that the dataset has been successfully created.

    Image

  3. If you enter an incorrect or non-existent field name in your query, AIV SQL Buddy will automatically detect the issue and display an appropriate error message with correction suggestions.

    Example:

    • Tables Used: InsuranceData
    • Input: “Show the policyholder name and their monthly income.”
    • Output:
       No reasonable field mapping exists for 'monthly income'. Available: `Policy Number`, `Policyholder Name`, `Policy Type`, `Premium Amount`, `Claim ID`, `Claim Status`, `Claim Amount`, `Claim Processing Time`, `Customer Churn Risk`, `Customer Satisfaction Score`, `Policy Start Date`, `Policy End Date`, `Region`, `Customer Lifetime Value (CLV)`, `Agent Name`. Try: [alternative]

In this way, AIV SQL Buddy simplifies query creation and execution. It allows you to write complex SQL queries without deep technical knowledge, automatically retrieves data based on your input, and saves time by generating accurate results quickly. You can easily customize queries using natural language and streamline database operations with user-friendly prompts, making the process more efficient and accessible.