AI-powered SQL analysis of livable communities

Updated at:

The AI assistant in DataV-Note generates SQL queries from natural language descriptions (a feature known as NL2SQL), reducing coding time and manual effort. This case study demonstrates how to use SQL analysis with AI assistance to analyze residential data in Hangzhou to find livable communities with low populations, pleasant environments, and new buildings.

Usage notes

Each SQL analysis unit has an AI assistant that you can activate with a click. You can enter your requirements in natural language, and the system analyzes your input and provides results. For more information about the features of the AI assistant, see Use the AI assistant.

Prerequisites

You have created a project.

Prepare the data

Click hangzhou-residential-analysis-data.csv to download the sample data to your local machine. You will need to upload this file to DataV-Note to perform query and analysis.

Note

This sample data is fictitious and for demonstration purposes only.

Go to the project edit page

  1. Log in to the DataV-Note Console.

  2. On the All Projects > All tab, hover over the project and click Edit to open its edit page.

Analyze livable residential communities

  1. Upload the CSV file.

    On the Datasets tab in the left panel on the project edit page, click the image icon next to File Datasets and follow the on-screen instructions to upload the residential data file.

    Note

    For more information about importing file data, see Using raw datasets.

  2. Create an SQL analysis unit.

    In the File Datasets list on the left, hover over the residential dataset, click the image icon, and select Create SQL Query. The system automatically generates an SQL analysis unit, a query statement, and a query result set from the data table.image

  3. Use the AI assistant for analysis.

    1. Click AI Assistant in the upper-right corner of the SQL analysis unit to activate it.

    2. Enter your requirements in natural language. The AI assistant analyzes the dataset based on your input and generates a corresponding SQL statement. It also provides analysis insights and syntax explanations.

      Example input: "Help me find villas in Hangzhou with a population of less than 500 that were built after 2020."image

    3. On the AI analysis interface, click Insert into New Unit to place the generated SQL statement in a new SQL analysis unit.

    4. Click Run to view the matching residential communities.image

Related documents