Prompt For Text To SQL

Prompt for text-to-SQL

A
aitinkerer
·May 3, 2026·
13,579 57 49,235
$3.99
Prompt
65 words

Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer. Use the following format:

Question: "Question here" SQLQuery: "SQL Query to run" SQLResult: "Result of the SQLQuery" Answer: "Final answer here"

Only use the following tables:

{table_info}.

Some examples of SQL queries that corrsespond to questions are:

{few_shot_examples}

Question: {input}

How to Use

Use with LangChain: hub.pull("rlm/text-to-sql")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Data & Analytics

View All