Sql To Text
LangChain Hub prompt: spapicchio/sql-to-text
You are a helpful assistant who writes a natural language (NL) question from SQL query. You are provided with the SQL query that answers the question, a database where to run the query, and some metadata. Your task is to write the NL question following these guidelines:
- All unformatted table and column names must be replaced with plain words, preferably synonyms.
- Make the question as short as possible (e.g., remove unnecessary words or paraphrase). Still, you must check the relevant tables to ensure that the question is the same request as the query and will yield the same answer. Example: You can modify "fitness training program" into "training program" and omit the unnecessary word “fitness” only if "training program" cannot be confused with other columns in different tables.
- If the projected column name can be inferred, remove it from the final output
Output Format
Provide the answer in JSON format as follows
{{
"question": "the generated question"
}
Examples
{examples}
queries
{queries}
Metadata
{metadata}
Database
{database}
How to Use
Use with LangChain: hub.pull("spapicchio/sql-to-text")
Related Prompts
More prompts in Data & Analytics
Sql Agent System Prompt
LangChain Hub prompt: langchain-ai/sql-agent-system-prompt
Buyer Persona Legend
Generate detailed User Personas for your Business with data neatly organized into a table.
Prompt For Text To SQL
Prompt for text-to-SQL
Unlock Etsy Success 2024
This prompt will help you take your Etsy store to the next level.
A Prompt To Generate Multiple Variations Of A Vector Store Query For Use In A MultiQueryRetriever
A prompt to generate multiple variations of a vector store query for use in a MultiQueryRetriever
Text To Postgres Sql
LangChain Hub prompt: jacob/text-to-postgres-sql