Chat and Quick Example for a Query

Overview

The Chat feature in SenseQL provides an interactive and intuitive way to ask questions related to your connected data sources. Users can type natural language queries, and SenseQL will automatically generate the corresponding SQL queries. 

It also presents the data in a table format and provides data visualizations for a clearer understanding of the results. Additionally, you can save frequently used queries for future access with the Saved Queries feature.

This guide will walk you through the main functionality of the Chat page and show how to quickly generate queries and visualize data.

Chat Interface

On the Chat page, you'll find a clean and user-friendly interface to input your data queries. Here's how it works:

  1. Ask a Question: At the bottom of the screen, you can enter your question or prompt. This could be a simple inquiry about your database, such as "Who are the most recent customers?" or more complex queries like "What is the total sales for last month by region?"

  2. SQL Query Generation: Once you submit your question, SenseQL generates the corresponding SQL query. The query is displayed just below your input in a code format for review.

    Example:

    SELECT first_name, last_name, registration_date 

FROM retail_db.customers 

ORDER BY registration_date DESC LIMIT 10

  1. Preview of SQL Query: Below the main SQL query, you can see a preview SQL query that provides a more detailed look at how the query is being formulated and executed against your dataset.

  2. Results Table: Once the SQL query is executed, the results are displayed in a table format. This makes it easy to inspect the data, check the values, and verify the query’s correctness.

    Example Table Preview:

customer_id

first_name

last_name

registration_date

10,000,713

Robin

Daniel

2024-02-04

10,000,808

Amber

Pearson

2024-02-15

10,000,340

Ruben

Glass

2024-02-19

  1. Data Visualization: Optionally, SenseQL can generate data visualizations based on your query results. These can range from bar charts to line graphs, offering you an intuitive view of your data.

  2. Exporting Data: If you want to further process the results, you can easily export them by clicking the “Export Output in CSV” button.

Saved Queries Feature

SenseQL offers a Saved Queries feature that allows you to save frequently used queries for easy future access. This is ideal if you need to re-run the same queries regularly or keep track of important queries you use often.

How to Save a Query

  1. Save Query with the Star Icon: After generating a query, simply click on the "Star" icon next to the SQL query. This action will save the query to your Saved Queries section for future use.

  2. Access Saved Queries: To access your saved queries, click on the "Saved Queries" section on the left sidebar. Here, you'll find all your saved queries listed.

Key Features

  • Natural Language Queries: Type your questions in plain language, and SenseQL will convert them into SQL.

  • SQL Preview: View the exact SQL query generated from your question.

  • Table View: Inspect the returned data in a structured, easy-to-read table format.

  • Data Visualization: Automatically generate charts or graphs for a visual representation of your data.

  • Exportable Data: Export query results to CSV for use in other tools.

Use Cases

  • Customer Insights: Get detailed customer information, such as registration dates, preferences, and purchase history.

  • Sales Analysis: Retrieve sales data by product, region, or time period.

  • Real-Time Reporting: Generate reports and insights based on live data in your connected databases.

By using the Chat feature in SenseQL, you can seamlessly interact with your data, generate SQL queries, and explore your results visually—all in an intuitive interface.

Quick Example for a Query

Let's walk through a quick example of how to use the Chat interface to ask for customer registration details:

  1. Input Your Question:
    Enter a question like:

"Retrieve the first name, last name, and registration date for the 10 customers with the most recent registration dates."

Generated SQL Query:
Once you submit your prompt, SenseQL will generate the corresponding SQL query:

SELECT first_name, last_name, registration_date 

FROM retail_db.customers 

ORDER BY registration_date DESC LIMIT 10

  1. View the Results:
    The results will appear in a table format, displaying the customer names and their registration dates, sorted by the most recent.

  2. Export/Visualize Data: You can then choose to export the data in CSV format or visualize it with a chart for more detailed analysis.

Create a free website with Framer, the website builder loved by startups, designers and agencies.