File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 76
76
-- Using reference for TABLES '{table_name}' {context}; {question_txt}?
77
77
78
78
SELECT"""
79
+
80
+ # https://colab.research.google.com/drive/13BIKsqHnPOBcQ-ba2p77L5saiepTIwu0#scrollTo=0eI-VpCkf-fN
81
+ STARCODER2_PROMPT = """
82
+ ### Instructions:
83
+ Your task is convert a question into a SQL query, given a sqlite database schema.
84
+ Adhere to these rules:
85
+ - **Deliberately go through the question and database schema word by word** to appropriately answer the question
86
+ - **Use Table Aliases** to prevent ambiguity. For example, `SELECT table1.col1, table2.col1 FROM table1 JOIN table2 ON table1.id = table2.id`.
87
+ - When creating a ratio, always cast the numerator as float
88
+
89
+ ### Input:
90
+ Generate a SQL query that answers the question `{question}`.
91
+ For SQL TABLE '{table_name}' sample question/answer pairs,\n ({sample_queries})
92
+ This query will run on a database whose schema is represented in this string:
93
+ CREATE TABLE '{table_name}' ({column_info}
94
+ );
95
+
96
+ -- Table '{table_name}' has sample values ({data_info_detailed})
97
+
98
+ ### Response:
99
+ Based on your instructions, here is the SQL query I have generated to answer the question `{question}`:
100
+ ```sql
101
+ SELECT"""
You can’t perform that action at this time.
0 commit comments