Back to Catalog

Talk to MySQL using Natural Language Query (NLQ) with AI

IntermediateGuided Project

Learn how to use AI-powered Natural Language Queries (NLQ) to interact with MySQL databases using plain English. You'll discover how to count, join, describe tables, and perform grouping operations - all without writing SQL code. This lab demonstrates how AI can transform data analysis by making it more intuitive and accessible. By enabling users to simply ask questions in everyday language, teams can quickly gain valuable insights from their data without needing SQL expertise.

4.7 (33 Reviews)

Language

  • English

Topic

  • Artificial Intelligence

Enrollment Count

  • 229

Skills You Will Learn

  • Artificial Intelligence, LangChain, MySQL, Natural Language Processing, Python, SQL

Offered By

  • IBMSkillsNetwork

Estimated Effort

  • 30 minutes

Platform

  • SkillsNetwork

Last Update

  • March 10, 2026
About this Guided Project
In this guided project, you will learn how to leverage AI-powered Natural Language Queries (NLQ) to interact with databases, like MySQL and MariaDB, using plain English. Through hands-on examples, you'll discover how to count records, describe table structures, join multiple tables, and perform grouping operations - all without writing SQL code. This lab demonstrates how AI can transform data analysis by making it more intuitive and accessible. By enabling users to simply ask questions in everyday language, teams can quickly gain valuable insights from their data without needing SQL expertise. In just 30 minutes, you'll set up a system that empowers business users and stakeholders to directly query databases, democratizing access to data-driven decision making.


Natural language query (NLQ)            
"How many employees are there"
AI-generated Structured Query Language (SQL)
SELECT COUNT(*) FROM Employee 
-------------------------------------------------------------------------------------------------------------------------
Natural language query (NLQ)            
"How many Albums are there in the database?"
AI-generated Structured Query Language (SQL)
SELECT COUNT(*) FROM Album          
-------------------------------------------------------------------------------------------------------------------------
Natural language query (NLQ)            
"Can you left join table Artist and table Album by ArtistId? Please show me 5 Name and AlbumId in the joint table."
AI-generated Structured Query Language (SQL)
SELECT Artist.Name, Album.AlbumId FROM Artist  LEFT JOIN Album ON Artist.ArtistId = Album.ArtistId LIMIT 5;
--------------------------------------------------------------------------------------------------------------------------------------
Natural language query (NLQ)            
" Which country's customers spent the most by invoice?"
AI-generated Structured Query Language (SQL)
SELECT Customer.Country, SUM(Invoice.Total) FROM Customer
INNER JOIN Invoice ON Customer.CustomerId = Invoice.CustomerId     
GROUP BY Customer.Country   
ORDER BY SUM(Invoice.Total) DESC LIMIT 1;   
--------------------------------------------------------------------------------------------------------------------------------------


**Natural Language Query (NLQ):** Describe the PlaylistTrack table
**Response:**

**Natural Language Query (NLQ):** How many employees are there
**Response:**


**Natural Language Query (NLQ):** Can you left join table Artist and table Album by ArtistId? Please show me 5 Name and AlbumId in the joint table.
**Response:**
  




What You'll Learn
After completing this project, you will be able to:

- **Integrate natural language processing**: Use AI tools to interpret natural language queries.
- **Execute SQL queries from natural language**: Translate natural language questions into SQL queries to fetch relevant data from the MySQL database.

What You'll Need
Before starting this guided project, you should have:
- An understanding of natural language processing concepts is beneficial but not required.
- Access to a modern web browser such as Chrome, Edge, Firefox, Internet Explorer, or Safari.