Welcome to ThanoSQL! This guide will help you get started with the basics of using ThanoSQL to integrate AI functionalities into your SQL queries seamlessly.

For the best experience, please use Google Chrome browser.

Prerequisites

Before you begin, ensure you have the following:

Procedures

Step 1: Setting Up Your Environment

  1. Sign In: Log in to your ThanoSQL account.
  2. Create a New Workspace: Navigate to the dashboard and create a new workspace to manage your queries and data. For more information about creating a workspace, check out the workspace page.

Step 2: Download the Data to Your Local Machine

First, download the dataset, which contains user reviews of a product. By running the following command in your terminal, or by visiting the dataset link here and downloading the file manually.

wget https://raw.githubusercontent.com/smartmind-team/assets/main/datasets/comments_data.csv

The dataset is a CSV file named comments_data.csv and contains the following columns:

  • ProductId: The unique identifier for the product.
  • UserId: The unique identifier for the user who submitted the review.
  • Text: The content of the user’s review.

Here’s a sample of what the dataset looks like:

ProductIdUserIdText
B005K4Q1VIA1BJHZE41QWBX6I received the K-cups on time and in excellent condition. I usually drink coffee, but at night the Hot cocoa is good with a snack, just before bed.
B005K4Q1VIA365A90ZY1Q80TThis is the best hot cocoa I’ve had in a K-Cup! The taste is smooth and creamy. It’s perfect for a cold morning or an evening hot drink. I would definitely recommend this product. The best part is that it can be ordered on auto delivery so I never run out.

Step 3: Uploading Data

To upload your dataset to ThanoSQL, follow these steps. ThanoSQL supports various file formats, including CSV and JSON.

1

Access Query Manager and Initiate Table Creation

Navigate to the Query Manager section in the ThanoSQL console and click on the Create Table button to start the process.

2

Choose the File Upload Option

Select the Upload Local File option. You can also choose Create New Table Manually for other use cases, but for this guide, we will use Upload Local File.

3

Set Up Your Table Configuration

For this quick guide, leave the default settings as they are. Simply enter the table name: review_comments_data.

4

Upload and Verify Your Data

After the upload is complete, navigate to the Table tab to verify that your table has been created successfully.

5

Inspect the Table Schema

Click on the table name to view the Table Schema, which provides details about the structure of your data.

You can click on the image to enlarge it for a better view.

6

Preview the Uploaded Data

Click the Preview button to inspect the data and ensure everything has been uploaded correctly.

Step 4: Writing Your First Query

To get started with querying your data in ThanoSQL, go back to Query Manager Editor and let’s write a simple SQL query to retrieve all records from your table.

  1. Basic Query: Retrieve all records from the review_comments_data table.
    SELECT * FROM review_comments_data;
    
    On execution, you will see all the records in the table:
    | ProductId     | UserId        | Text                                                                                                       |
    |---------------|---------------|------------------------------------------------------------------------------------------------------------|
    | B005K4Q1VI    | A1BJHZE41QWBX6| I received the K-cups on time and in excellent condition. I usually drink coffee, but at night the Hot cocoa is good with a snack, just before bed. |
    | B005K4Q1VI    | A365A90ZY1Q80T| This is the best hot cocoa I've had in a K-Cup! The taste is smooth and creamy. It's perfect for a cold morning or an evening hot drink. I would definitely recommend this product. The best part is that it can be ordered on auto delivery so I never run out. |
    ...
    

Step 5: Utilizing Pre-Built AI Models

ThanoSQL offers powerful pre-built AI models that you can easily integrate into your queries. To make the most of these models, ensure you understand the core ThanoSQL functions:

A solid understanding of these functions will help you fully leverage ThanoSQL’s AI capabilities. Familiarize yourself with the ThanoSQL functions mentioned above to maximize the effectiveness of the pre-built AI models.

  1. Sentiment Analysis: Use a pre-built AI model to predict the sentiment of user reviews.

    SELECT 
        thanosql.predict(
            input := 'Text',
            model := 'bhadresh-savani/distilbert-base-uncased-emotion'
        ) AS predicted_sentiment
    FROM review_comments_data;
    

    On execution, you will get the predicted sentiment for each review:

    | predicted_sentiment                               |
    |---------------------------------------------------|
    | {"label": "anger", "score": 0.47565987706184387}  |
    | {"label": "anger", "score": 0.47565987706184387}  |
    | {"label": "anger", "score": 0.47565987706184387}  |
    | {"label": "anger", "score": 0.47565987706184387}  |
    | {"label": "anger", "score": 0.47565987706184387}  |
    ...
    

By following these steps, you can start exploring and analyzing your data using ThanoSQL’s integrated AI functionalities.

Conclusion

Congratulations! You’ve now completed the Quick Start Guide for ThanoSQL. You are ready to harness the power of AI directly within your SQL queries. Dive deeper into advanced features and integrate sophisticated AI models to elevate your data operations. Happy querying!

More Resources

Use Cases Overview

Explore a variety of real-world applications and examples of ThanoSQL in action. Learn how to apply ThanoSQL to different scenarios to unlock powerful insights and efficiencies.

Workspace Management and Optimization

Get a thorough understanding of how to manage and optimize your ThanoSQL workspace, including tips for efficient data organization and query management.