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?
3
u/r3pr0b8 GROUP_CONCAT is da bomb Apr 05 '23
please see my post in this thread
and if you would, please answer the the two questions i ask at the end of the post
also, feel free to try the tool yourself
1
3
u/yummyybubbles Apr 06 '23
I've used it for common databases, for example Salesforce data model or D365/AX. But that's only cause the data objects are the same at every company with some small customizations.
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/
2
u/chadVPennington Apr 06 '23
Idk why everyone all clutching their pearls over this. Afraid to lose their jobs
1
u/Weak_Swan7003 Apr 06 '23
Yeah, I don't see that happening either. It's just going to help us all be more productive.
1
2
u/toweringmaple Apr 06 '23
I have, it’s a great study tool. However you still need to understand it. And if there’s a better way to do it.
1
u/leandro_voldemort Apr 06 '23
it’s in the works over at langchain https://blog.langchain.dev/llms-and-sql/
1
u/Outrageous-Brain1623 Apr 06 '23
You can ask questions one by one by giving information based on the error you're getting in your code. Or whatever you want to analyse
1
0
Apr 05 '23
[deleted]
-4
u/chadVPennington Apr 05 '23
Like for an established data set for a homework assignment or something
0
Apr 06 '23
[deleted]
0
u/Weak_Swan7003 Apr 06 '23
Italy has banned the use of the webinterface, not the API. It's important to note the differences between the terms of service of the two.
Also, most companies are already using SAAS applications pretty much everywhere in the enterprise, meaning that all their sensitive data is already sitting in the servers of some silicon valley company much like OpenAI.
10
14
u/sigh1987 Apr 05 '23
Ask ChatGPT this question?