I’ve not tried it, but looks kinda old… Might give it a try?
Setting up a good system prompt with a few examples might do better… or searching forum as I’m sure a few people have tried natural language to SQL before.
I’m trying to show you how to fish, but @_j might show up with a pile of fish on a silver platter given time!
You’re on the right path… I’d start experimenting some after searching for previous attempts by others… We’ve got a great resource on this forum, but it can take a bit of time to search around and learn from the mistakes and successes of others.
Good luck!
ETA: Here’s a few…
https://community.openai.com/search?q=natural%20language%20sql
I’ve not needed that functionality, so I haven’t followed closely. The path has been traveled before, though!