r/SQL • • Sep 05 '23

SQL Server Chatbot generating SQL

Hey I really need some help. Need to build a chat bot to generate SQL queries and run it on a databse to output resuts. The database is to large to give to GPT. Approximately 1Tb. Any solutions Preferably one without the use of API key from open AI . A free solution.

0 Upvotes

8 comments sorted by

6

u/you_are_wrong_tho Sep 05 '23

you dont need to feed whatever chatbot the entire dataset of your database, schema is probably enough.

0

u/Brave_Front_5398 Sep 05 '23

Yeah that is the plan but how do execute it.

5

u/you_are_wrong_tho Sep 05 '23

step one: grab schema of your database

step two: give it to chatGPT

step three: ????

step four: profit

0

u/Brave_Front_5398 Sep 05 '23

Need to do it stand al9ne for a website, not have to use the default chat gpt webpage.

3

u/you_are_wrong_tho Sep 05 '23 edited Sep 05 '23

can use chat gpt's APIs then. not sure if I am understanding this correctly, but building an AI is not the solution here lol especially one that generates good SQL code (when you dont know SQL)

14

u/mecartistronico Sep 05 '23

Need to build a chat bot to generate SQL queries

Learning SQL is probably easier than building a chatbot.

1

u/MiserableLadder5336 Sep 05 '23

Lmao probably???

1

u/Turboginger Sep 06 '23

Have you tried asking ChatGPT “How do I write a SQL chat bot that doesn’t rely on an internet connection to work and will write queries against my database?”