Writing queries to solve analytical problems is a core task for a lot of data users. The challenge is to find the right data and translate the problem into correct and efficient SQL code. This becomes more difficult when data is spread across different domains.
I'm trying to build a text-to-SQL feature that translates the analytical query into SQL code.
This will be a straightforward solution where we use an LLM.
-
The user asks an analytical question and chooses the tables to be used.
-
Relevant table schemas are retrieved from the store.
-
Prompt is created with the question and table schemas.
-
The prompt is then fed to the LLM.
-
Streaming response is generated and displayed to the user.