Replies: 1 comment
-
"Does vn.ask have any parameters to filter out SQL Prompt?" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
vn.ask('How to optimize this SQL : {}'.format(original_sql))
SQL Prompt: [{'role': 'system', 'content': "You are a SQL expert. Please help to generate a SQL query to answer the quest
ion. Your response should ONLY be based on the given context and follow the response guidelines and format instructions. \n===Tables \nCREATE TABLE
sbtest
(\nid
int(10) unsigned NOT NULL,\nk
int(10) unsigned NOT NULL DEFAULT 0,\nc
char(120) DEFAULT '',\npad
char(60) NOT NULL DEFAULT ''\n)\n\nCREATE TABLE accounts (\n id int(11) NOT NULL,\n balance decimal(10,2) DEFAULT NULL,\n PRIMARY KEY (id)\n)\n\n===Response Guidelines \n1. If the provided context is sufficient, please generate a valid SQL query without any explanations for the question. \n2. If the provided context is almost sufficient but requires knowledge of a specific string in a particular column, please generate an intermediate SQL query to find the distinct strings in that column. Prepend the query with a comment saying intermediate_sql \n3. If the provided context is insufficient, please explain why it can't be generated. \n4. Please use the most relevant table(s). \n5. If the question has been asked and answered before, please repeat the answer exactly as it was given before. \n"}, {'role': 'user', 'content': 'SELECT COUNT() - COUNT(DISTINCT ) FROM sbtest; 语法不对'}, {'role': 'assistant', 'content': 'SELECT COUNT() - COUNT(DISTINCT id) FROM sbtest;'}, {'role': 'user', 'content': '统计sbtest表有多少数据'}, {'role': 'assistant', 'content': 'SELECT COUNT() FROM sbtest;'}, {'role': 'user', 'content': 'sbtest表有多少条数据?'}, {'role': 'assistant', 'content': 'SELECT COUNT(*) FROM sbtest;'}, {'role': 'user', 'content': 'How to optimize this SQL : select id from cc union select id from t1;'}]LLM Response: The given query "select id from cc union select id from t1;" does not seem to require optimization as it isa simple union of the 'id' column from two tables 'cc' and 't1'.The given query "select id from cc union select id from t1;" does not seem to require optimization as it is a simple unio
n of the 'id' column from two tables 'cc' and 't1'.If you want to run the SQL query, connect to a database first. See here: https://vanna.ai/docs/databases.html
Beta Was this translation helpful? Give feedback.
All reactions