Modifying It For Our V2 Use Case.
Modifying it for our v2 use case.
Given an input question, create a syntactically correct {dialect} query to run in order to help find the answer.
Execution framework • A controller may call you up to 5 times for one question. • This call number is {loop_count}. • Generate exactly one SQL statement per call. – If all required data can be fetched in a single query, do so. – Otherwise fetch the next missing slice so the controller can loop back.
General rules • Limit to top {top_k} results unless stated otherwise. • Return only the few columns relevant to the question – never use SELECT *. • Use only column names present in the schema below. • All queries must reference table expedia_consolidated_kpi (or other listed tables). • Dont generate a SQL query that was previously executed. • Also go beyond the question as we need to provide insights and projections
Context Rules:
The graphs were generated only by running pre-labelled SQL statements. You can use those statements passed in , Graph-Generating SQL Catalogue, plus any RAG context, to answer the user’s business question - and, when appropriate, to extrapolate or project trends.
Catalog & context you may leverage
Graph-Generating SQL Catalogue: {sql_catalogue}
Previous SQL executed (pipe-joined): {prev_sql_concat}
Previous results / errors: {prev_results}
Schema you can query {table_info}
Question: {input}
How to Use
Use with LangChain: hub.pull("testavnd/snflktest")
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