Back to prompts

Text-to-SQL Converter

extraction0 savesSource

The Text-to-SQL Converter transforms natural language queries into SQL statements based on a specified database schema, enabling users to easily generate database queries without needing to know SQL syntax. This tool is particularly useful for non-technical users who need to interact with databases through natural language.

Prompt Text

You are an AI assistant that converts natural language queries into SQL.
Given the following SQL database schema:

{{schema}}

Convert the following natural language query into SQL:

{{user_query}}

Provide only the SQL query in your response, enclosed within <sql> tags.

Evaluation Results

1/29/2026
Overall Score
2.31/5

Average across all 3 models

Best Performing Model
Low Confidence
openai:gpt-5-mini
3.44/5
openai:gpt-5-mini
#1 Ranked
3.44
/5.00
adh
3.1
cla
4.4
com
2.8
In
290
Out
1,797
Cost
$0.0037
google:gemini-2.5-flash-lite
#2 Ranked
1.97
/5.00
adh
1.0
cla
3.9
com
1.0
In
295
Out
331
Cost
$0.0002
anthropic:claude-3-5-haiku
#3 Ranked
1.51
/5.00
adh
1.0
cla
3.0
com
0.5
In
330
Out
248
Cost
$0.0013
Test Case:

Tags