Skip to content

Mission 6: Advanced Queries with SQL

Learning Objective

Learn how to execute custom queries on your data using SQL code generated from natural language prompts.


Knowledge Requirement

Basic knowledge of SQL is recommended for this mission.


Dataset

Download the required dataset: new_table_cars.xlsx


Step-by-Step Instructions

1. Open Your Dataset

Open the data you want to query.

2. Enter a Natural Language Prompt

In the search bar, write your prompt and press Enter. LOGIBLOX will generate SQL code based on your request.

3. View the Generated SQL Code

On the right side of the input field, click the code icon to open the code snippet. This shows the SQL code that has been generated for your prompt.

4. Modify and Execute

Modify the SQL code to your requirements and press Run to execute your custom query.


Visual Guide

Generated SQL Code

Generated SQL

The prompt is converted to SQL code. The AVG function calculates the average for each Manufacturer

Result

Modified SQL Query

Modified SQL

We can modify the SQL code to return the SUM instead - showing total value sold per car

Benefits of SQL Queries

  • Precision - Fine-tune queries to exact specifications
  • Flexibility - Use any SQL function or operation
  • Learning - See how natural language converts to SQL
  • Customization - Modify generated code for advanced analytics

Summary

You've successfully learned how to:

✓ Generate SQL code from natural language prompts

✓ View and understand the generated SQL

✓ Modify SQL code for custom queries

✓ Execute advanced queries on your data


Well done! Now let's move on to the next mission!