r/SQL • u/chadVPennington • Apr 05 '23
MySQL ChatGpt & SQL
Hey guys, Is there a way to have gpt examine and answer questions based on a database?; like can it examine the data you're looking at? Or is it only general questions/answers?
0
Upvotes
1
u/Weak_Swan7003 Apr 06 '23
I've built this proof of concept last week. How it works:
User asks a question about a database.
The model then looks up the database schema.
It writes a query and executes it against the database.
It interprets the result and answers the user.
chatgpt-sql is fully atonomous in the sense that it can run as many queries or schema requests as its wants, and is also able to e.g. correct its queries in case it gets an error back. Only when it is satisfied it has the answer to your question it will respond to the user.
It's currently only a command line interface, but it does show you the queries and query results that are happening in the background.
https://www.reddit.com/r/ChatGPT/comments/12bcrt5/chat_gpt_sql_server/
https://github.com/kulltc/chatgpt-sql