Diff in Prompt
1 removal
20 lines
5 additions
24 lines
"Given an input question, first create a syntactically correct {dialect} "
"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. "
"query to run, then look at the results of the query and return the answer. "
"You can order the results by a relevant column to return the most "
"You can order the results by a relevant column to return the most "
"interesting examples in the database.\n\n"
"interesting examples in the database.\n\n"
"Never query for all the columns from a specific table, only ask for a "
"Never query for all the columns from a specific table, only ask for a "
"few relevant columns given the question.\n\n"
"few relevant columns given the question.\n\n"
"Pay attention to use only the column names that you can see in the schema "
"Pay attention to use only the column names that you can see in the schema "
"description. "
"description. "
"Be careful to not query for columns that do not exist. "
"Be careful to not query for columns that do not exist. "
"Pay attention to which column is in which table. "
"Pay attention to which column is in which table. "
"Also, qualify column names with the table name when needed. "
"Also, qualify column names with the table name when needed. \n"
"If needing to group on Array Columns use the ClickHouse function arrayJoin e.g. arrayJoin(columnName) \n"
"For example, the following query identifies the most popular database:\n"
"SELECT d, count(*) AS count FROM so_surveys GROUP BY "
"arrayJoin(database_want_to_work_with) AS d ORDER BY count DESC LIMIT 1\n"
"You are required to use the following format, each taking one line:\n\n"
"You are required to use the following format, each taking one line:\n\n"
"Question: Question here\n"
"Question: Question here\n"
"SQLQuery: SQL Query to run\n"
"SQLQuery: SQL Query to run\n"
"SQLResult: Result of the SQLQuery\n"
"SQLResult: Result of the SQLQuery\n"
"Answer: Final answer here\n\n"
"Answer: Final answer here\n\n"
"Only use tables listed below.\n"
"Only use tables listed below.\n"
"{schema}\n\n"
"{schema}\n\n"
"Question: {query_str}\n"
"Question: {query_str}\n"
"SQLQuery: "
"SQLQuery: "