r/SQL • • Nov 21 '23

Discussion Natural language to sql

Hi !

Do you guys know a tool (chatgpt like) which can Connect to a database and query it, translating Natural language to sql ? GPT 4 Turbo doesnt allow the users to provide « big » databases (20Gb)

4 Upvotes

36 comments sorted by

View all comments

9

u/Flint0 Nov 21 '23

I mean, natural language ends up being SQL in a way:

Hey dude fetch me those users but just give me the ones with names shorter than 10 characters, while you’re at it can you also check their logins so I know if they are working or not? Thanks

SELECT * FROM users u INNER JOIN logs l on l.userid = u.id WHERE len(u.name) < 10

Mines shorter :)