Draft SQL from table definitions and a plain-language request
At a glance
A developer uses ChatGPT to draft SQL from schema definitions and then reviews and corrects the query. This workflow is listed under Coding.
- Agents / tools
- OpenAI
SourceBuilding a tool for these workflows? See weekly rates.
What they did
1) Gather the definitions of the tables relevant to the query and paste them into ChatGPT. 2) Describe in plain English what result the query should return; the author says they do not have to name every table or column because ChatGPT can infer the matches from the definitions. 3) Read the generated SQL for correctness. If it is wrong, feed any errors back to ChatGPT and ask it to correct the query, then review the revised result before using it.
How it went
The commenter estimates this saves at least half an hour per moderately complex query, while noting that initial answers are sometimes wrong.