Talk to SQL Database using LangChain & OpenAI | Query SQL Database through Natural Language

preview_player
Показать описание
Schedule a 1 Hour Consulting session to
(1) answer your personalized questions, (2) help get your data science projects done, (3) draw a roadmap for your data science career.

Do you need to derive insight from your data? Fill out the form on our solution page, explain what you need, and we will get back to you with an offer.

-----------------
This tutorial demonstrates how to leverage LangChain and OpenAI to interact with a sample SQL database through natural language queries.

We show that a large language mode can be used to convert a natural language query to a valid SQL command, run it to retrieve information from the database and interpret the result using the large language model again.

We'll guide you through setting up the environment, loading API keys, and creating a database connection.

Watch as we seamlessly convert conversational prompts into SQL commands, execute them, and retrieve meaningful data—all within a Jupyter Notebook.

Learn how to easily handle potential SQL errors with the built-in query checker and explore database tables.

Whether you're a beginner or experienced with SQL, this video will show you how to make data retrieval more intuitive using AI.

Don't forget to like, share, and subscribe for more tutorials!
Комментарии
Автор

Schedule a 1 Hour Consulting session to
(1) answer your personalized questions, (2) help get your data science projects done, (3) draw a roadmap for your data science career.

Do you need to derive insight from your data? Fill out the form on our solution page, explain what you need, and we will get back to you with an offer.

CompuFlair
Автор

Thanks for sharing this tutorial - however, it seems like as of 2024-Dec-30, the result value has changed. In your example, it shows 8. But when I ran mine with the same code (different query and I use MySQL database), the "result" returns a string with two arguments: "Question" with the query value, and "SQLQuery" with the SQL statement that langchain/llm generated. Just wanted to point out that the SQLResult from my verbose=True output shows a list of ONE tuple like yours did at 6:30 and is showing correctly. Not sure why the value in SQLResult does not show up in the value of the ai_msg['Result'] ? Appreciate your input.

Stewty
Автор

Does anyone know if there are community utilities but for the JavaScript/TS version of Langchain?

hcg
Автор

nice! thumbs up! -> does this also work with microsoft sql?

youtubeccia
join shbcf.ru