I have 300 tables, each table has multiple columns.
Objective :
I want to build genai solution so that
- If user ask question, that natural language question need to be converted to SQL query
- Run SQL query and fetch the data
- Provide this result to LLM to get final answer
Solutions I have built
- Using metadata information. I passed metadata information about 8-10 tables in prompt, so LLM is able to generate SQL query correctly. But this is not possible with 300 tables
Is there any proper solution available to
- Generate SQL query without passing metadata information about all 300 tables
- Efficient way to select the best matching tables, and use those best selected table’s metadata information for generating SQL query.
Please let me know what is the correct way to do this