SQL Easy mode:
If you have the ability: Copy the metadata from a database (Just the field names, data types, any constraints), feed that in as a .txt or .md in the index.
You now never have to write any sql again yourself. With that metadata you can generate 99% accurate SQL queries with the appropriate ‘query’ to the ai models.