Using GPT3 on database schamas

Is it possible to give GPT3 your database schema, so that it will know about your databse, and then ask it to perform questions from it?


I’ve seen people using CODEX to generate SQL queries so I assume so.

That’s generally possible with the combination of /search and /completion (with Codex) endpoints.

  1. use search, to given a user query, find the most relevant tables from the schema
  2. use /completions, where inside the comment you show the most likely relevant tables, and then you add user query, and ask Codex to complete the SQL statement. Step 2 is shown in this example.

Can we use answers api instead? As it inherently does both search and completion for us?