Back to Catalog

Query SQL with LangChain and Granite3 using Natural language

IntermediateGuided Project

Use LangChain and the IBM's WatsonX Granite 3 large language model (LLM) to enable intuitive querying of MySQL databases using natural language. By translating natural language queries into SQL commands and executing them with LLMs, you simplify complex data manipulation and analysis. This approach makes data querying more accessible and efficient for professionals across various industries, streamlining workflows and enhancing decision-making processes.

4.4 (52 Reviews)

Language

  • English

Topic

  • Artificial Intelligence

Enrollment Count

  • 338

Skills You Will Learn

  • LLM, LangChain, MySQL, SQL, Python

Offered By

  • IBMSkillsNetwork

Estimated Effort

  • 30 minutes

Platform

  • SkillsNetwork

Last Update

  • March 18, 2025
About this Guided Project

Overview

In the rapidly evolving data management landscape, the efficiency of your database interactions can have a big influence on your business outcomes and strategic insights. In this guided project, you'll create an intelligent agent-to-database interaction through natural language. By leveraging the capabilities of LangChain and IBM's WatsonX Granite 3 LLM, you'll learn how to bridge the gap between complex SQL queries and conversational language. Transform your approach to database management by making data queries more intuitive, accessible, and engaging for users across different professional backgrounds.


Objectives

In the project, you will:

  • Integrate natural language processing: Use tools like LangChain and large language models (LLM) such as Granite 3 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

For this guided project, you need a basic knowledge of Python and SQL.

Instructors

Kang Wang

Data Scientist

I am a Data Scientist in the IBM. I am also a PhD Candidate in the University of Waterloo.

Read more

Karan Goswami

Data Scientist

I am a dedicated Data Scientist and an AI enthusiast, currently working at IBM's Skills Builder Network. Learning how some simple mathematical operations could be used to make predictions and discover patterns sparked my curiosity, leading me to explore the exciting world of AI. Over the years, I’ve gained hands-on experience in building scalable AI solutions, fine-tuning models, and extracting meaningful insights from complex datasets. I'm driven by a desire to apply these skills to solve real-world problems and make a meaningful impact through AI.

Read more

Wojciech "Victor" Fulmyk

Data Scientist at IBM

As a data scientist at the Ecosystems Skills Network at IBM and a Ph.D. candidate in Economics at the University of Calgary, I bring a wealth of experience in unraveling complex problems through the lens of data. What sets me apart is my ability to seamlessly merge technical expertise with effective communication, translating intricate data findings into actionable insights for stakeholders at all levels. Follow my projects to learn data science principles, machine learning algorithms, and artificial intelligence agent implementations.

Read more

Contributors

Ricky Shi

Data Scientist at IBM

Ricky Shi is a Data Scientist at IBM, specializing in deep learning, computer vision, and Large Language Models. He applies advanced machine learning and generative AI techniques to solve complex challenges across various sectors. As an enthusiastic mentor, Ricky is committed to helping colleagues and peers master technical intricacies and drive innovation.

Read more