Skip to content

AIV SQL Buddy

AIV SQL Buddy is an intelligent SQL generation tool that converts natural language queries (NLP) 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

Image

  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.

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

  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.

    Example:

    • Tables Used: products, orderdetails, orders, customers
    • Input 1: “Display the names of the products.”
    • Output 1:
      SELECT productName 
      FROM products
    • Input 2: “Where the quantity ordered is greater than 50.”
    • Output 2:
      SELECT productName 
      FROM products 
      WHERE quantityInStock > 50
    • Input 3: “Show the product names and their corresponding order numbers along with the customer names.”
    • Output 3:
      SELECT products.productName, orders.orderNumber, customers.customerName
      FROM products
      JOIN orderdetails ON products.productCode = orderdetails.productCode
      JOIN orders ON orderdetails.orderNumber = orders.orderNumber
      JOIN customers ON orders.customerID = customers.customerID
      WHERE products.quantityInStock > 50
  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.
  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.

  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.

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

  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.

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 be appear. 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., Products). In the General tab, choose the Datasource and Source. For example, select JDBC as the datasource and Training as the source for JDBC. Once you select the source, a Generate with AI button will appear in the top-right corner.

    Image

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

    Image

  1. Write your query in the Input box (e.g., Display the names and quantity in stock of all products).

  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., Display products with quantity greater than 10.), it will automatically merge with the existing query to refine the results further.

    Image

  1. Once the query is generated, copy it and paste it into the Dataset Query box. Click the PREVIEW button to check if the query is applied correctly. After verification, click the CREATE button.

    Image

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

    Image

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.