question
stringlengths 23
286
| sql
stringlengths 29
1.45k
| db_id
stringclasses 11
values | prompt
stringlengths 1.09k
6.84k
| question_id
int64 0
1.53k
| difficulty
stringclasses 3
values |
---|---|---|---|---|---|
Among all events hold by the Student_Club in 2019, find the percentage share of events related to 'Community Service' | SELECT CAST(SUM(CASE WHEN type = 'Community Service' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(type) FROM event WHERE SUBSTR(event_date, 1, 4) = '2019' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among all events hold by the Student_Club in 2019, find the percentage share of events related to 'Community Service' None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,400 | moderate |
Indicate the cost of posters for 'September Speaker' event. | SELECT T3.cost FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'September Speaker' AND T3.expense_description = 'Posters' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Indicate the cost of posters for 'September Speaker' event. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,401 | moderate |
What is the most popular size of t-shirt ordered by the club members? | SELECT t_shirt_size FROM member GROUP BY t_shirt_size ORDER BY COUNT(t_shirt_size) DESC LIMIT 1 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the most popular size of t-shirt ordered by the club members? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,402 | simple |
Indicate the name of the closed event whose cost has exceeded the budget the most. | SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T2.event_id = T1.link_to_event WHERE T1.event_status = 'Closed' AND T1.remaining < 0 ORDER BY T1.remaining LIMIT 1 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Indicate the name of the closed event whose cost has exceeded the budget the most. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,403 | moderate |
Identify the type of expenses and their total value approved for 'October Meeting' event. | SELECT T1.type, SUM(T3.cost) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'October Meeting' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Identify the type of expenses and their total value approved for 'October Meeting' event. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,404 | moderate |
Calculate the amount budgeted for 'April Speaker' event. List all the budgeted categories for said event in an ascending order based on their amount. | SELECT SUM(T2.amount), T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'April Speaker' ORDER BY T2.amount | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the amount budgeted for 'April Speaker' event. List all the budgeted categories for said event in an ascending order based on their amount. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,405 | moderate |
Among the budgets for Food, which one has the highest budgeted amount? | SELECT budget_id FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget ) | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among the budgets for Food, which one has the highest budgeted amount? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,406 | simple |
Among the budgets for Advertising, list out top three which have the most budgeted amount? | SELECT budget_id FROM budget WHERE category = 'Advertisement' ORDER BY amount DESC LIMIT 3 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among the budgets for Advertising, list out top three which have the most budgeted amount? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,407 | simple |
Calculate the total cost spent for Parking in the list. | SELECT SUM(cost) FROM expense WHERE expense_description = 'Parking' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the total cost spent for Parking in the list. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,408 | simple |
Mention the total expense used on 8/20/2019. | SELECT SUM(cost) FROM expense WHERE expense_date = '2019-08-20' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Mention the total expense used on 8/20/2019. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,409 | simple |
List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred? | SELECT T1.first_name, T1.last_name, SUM(T2.cost) FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.member_id = 'rec4BLdZHS2Blfp4v' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,410 | simple |
State what kind of expenses that Sacha Harrison incurred? | SELECT T2.expense_description FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Sacha' AND T1.last_name = 'Harrison' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
State what kind of expenses that Sacha Harrison incurred? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,411 | simple |
What kind of expenses incurred by members who have X-Large in size of tee shirt? | SELECT T2.expense_description FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.t_shirt_size = 'X-Large' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What kind of expenses incurred by members who have X-Large in size of tee shirt? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,412 | simple |
Mention the zip code of member who incurred less than 50USD. | SELECT T1.zip FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T2.cost < 50 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Mention the zip code of member who incurred less than 50USD. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,413 | simple |
State the name of major that Phillip Cullen has joined. | SELECT T1.major_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.first_name = 'Phillip' AND T2.last_name = 'Cullen' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
State the name of major that Phillip Cullen has joined. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,414 | simple |
List out the position of members who joined major of Business. | SELECT T2.position FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T1.major_name = 'Business' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List out the position of members who joined major of Business. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,415 | simple |
How many members of Business have the Medium size of tee shirt? | SELECT COUNT(T2.member_id) FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T1.major_name = 'Business' AND T2.t_shirt_size = 'Medium' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
How many members of Business have the Medium size of tee shirt? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,416 | simple |
List out the type of events which have remaining budget more than 30 USD. | SELECT T1.type FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.remaining > 30 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List out the type of events which have remaining budget more than 30 USD. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,417 | simple |
Mention the category of events which were held at MU 215. | SELECT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Mention the category of events which were held at MU 215. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,418 | simple |
What is the category of event which was taken place in 2020-03-24T12:00:00? | SELECT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_date = '2020-03-24T12:00:00' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the category of event which was taken place in 2020-03-24T12:00:00? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,419 | simple |
State the name of major that Vice President has joined. | SELECT T1.major_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Vice President' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
State the name of major that Vice President has joined. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,420 | simple |
Calculate the percentage of members who are major Mathematics in the list? | SELECT CAST(SUM(CASE WHEN T2.major_name = 'Mathematics' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.position = 'Member' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the percentage of members who are major Mathematics in the list? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,421 | moderate |
State the category of events were held at MU 215. | SELECT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
State the category of events were held at MU 215. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,422 | simple |
How many income are received with an amount of 50? | SELECT COUNT(income_id) FROM income WHERE amount = 50 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
How many income are received with an amount of 50? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,423 | simple |
Among the members, how many of them have an extra large t-shirt size? | SELECT COUNT(member_id) FROM member WHERE position = 'Member' AND t_shirt_size = 'X-Large' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among the members, how many of them have an extra large t-shirt size? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,424 | simple |
In the College of Agriculture and Applied Sciences, how many majors are under the department of School of Applied Sciences, Technology and Education? | SELECT COUNT(major_id) FROM major WHERE department = 'School of Applied Sciences, Technology AND Education' AND college = 'College of Agriculture AND Applied Sciences' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
In the College of Agriculture and Applied Sciences, how many majors are under the department of School of Applied Sciences, Technology and Education? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,425 | simple |
List the last name of members with a major in environmental engineering and include its department and college name. | SELECT T2.last_name, T1.department, T1.college FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Member' AND T1.major_name = 'Environmental Engineering' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the last name of members with a major in environmental engineering and include its department and college name. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,426 | moderate |
What are the budget category of the events located at MU 215 and a guest speaker type with a 0 budget spent? | SELECT DISTINCT T2.category, T1.type FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215' AND T2.spent = 0 AND T1.type = 'Guest Speaker' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What are the budget category of the events located at MU 215 and a guest speaker type with a 0 budget spent? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,427 | moderate |
List the city and state of members enrolled under electrical and computer engineering department. | SELECT city, state FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major INNER JOIN zip_code AS T3 ON T3.zip_code = T1.zip WHERE department = 'Electrical and Computer Engineering Department' AND position = 'Member' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the city and state of members enrolled under electrical and computer engineering department. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,428 | moderate |
What is the name of the social event that was attended by the vice president of the Student_Club located at 900 E. Washington St.? | SELECT T2.event_name FROM attendance AS T1 INNER JOIN event AS T2 ON T2.event_id = T1.link_to_event INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id WHERE T3.position = 'Vice President' AND T2.location = '900 E. Washington St.' AND T2.type = 'Social' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the name of the social event that was attended by the vice president of the Student_Club located at 900 E. Washington St.? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,429 | challenging |
What is the last name and position of the student that bought pizza on 09/10/2019? | SELECT T1.last_name, T1.position FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T2.expense_date = '2019-09-10' AND T2.expense_description = 'Pizza' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the last name and position of the student that bought pizza on 09/10/2019? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,430 | moderate |
List the last name of the members of the club that attended the women's soccer event. | SELECT T3.last_name FROM attendance AS T1 INNER JOIN event AS T2 ON T2.event_id = T1.link_to_event INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id WHERE T2.event_name = 'Women''s Soccer' AND T3.position = 'Member' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the last name of the members of the club that attended the women's soccer event. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,431 | moderate |
Among the members with t-shirt size of medium, what is the percentage of the amount 50 received by the Student_Club? | SELECT CAST(SUM(CASE WHEN T2.amount = 50 THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.income_id) FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.position = 'Member' AND T1.t_shirt_size = 'Medium' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among the members with t-shirt size of medium, what is the percentage of the amount 50 received by the Student_Club? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,432 | moderate |
Which countries have zip codes with post office boxes? | SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Which countries have zip codes with post office boxes? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,433 | simple |
What are the zip codes that have post office boxes in the country of the country of San Juan Municipio whose state is Puerto Rico? | SELECT zip_code FROM zip_code WHERE type = 'PO Box' AND county = 'San Juan Municipio' AND state = 'Puerto Rico' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What are the zip codes that have post office boxes in the country of the country of San Juan Municipio whose state is Puerto Rico? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,434 | simple |
List the names of closed event as "game" that was closed from 3/15/2019 to 3/20/2020. | SELECT DISTINCT event_name FROM event WHERE type = 'Game' AND date(SUBSTR(event_date, 1, 10)) BETWEEN '2019-03-15' AND '2020-03-20' AND status = 'Closed' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the names of closed event as "game" that was closed from 3/15/2019 to 3/20/2020. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,435 | moderate |
Please provide links to events for members who have paid more than 50 dollar. | SELECT DISTINCT T3.link_to_event FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member WHERE T1.cost > 50 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Please provide links to events for members who have paid more than 50 dollar. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,436 | simple |
Which members who were approved from 1/10/2019 to 11/19/2019? Please identify the member who attended the event and the link to their event. | SELECT DISTINCT T1.link_to_member, T3.link_to_event FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member WHERE date(SUBSTR(T1.expense_date, 1, 10)) BETWEEN '2019-01-10' AND '2019-11-19' AND T1.approved = 'true' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Which members who were approved from 1/10/2019 to 11/19/2019? Please identify the member who attended the event and the link to their event. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,437 | challenging |
Please indicate the college of the person whose first name is Katy with the link to the major "rec1N0upiVLy5esTO". | SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.link_to_major = 'rec1N0upiVLy5esTO' AND T1.first_name = 'Katy' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Please indicate the college of the person whose first name is Katy with the link to the major "rec1N0upiVLy5esTO". None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,438 | simple |
Please list the phone numbers of the members who majored in business at the College of Agriculture and Applied Sciences. | SELECT T1.phone FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T2.major_name = 'Business' AND T2.college = 'College of Agriculture and Applied Sciences' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Please list the phone numbers of the members who majored in business at the College of Agriculture and Applied Sciences. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,439 | moderate |
List emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019. | SELECT DISTINCT T1.email FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE date(SUBSTR(T2.expense_date, 1, 10)) BETWEEN '2019-09-10' AND '2019-11-19' AND T2.cost > 20 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,440 | moderate |
How many members have education major in the College of Education & Human Services? | SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.position = 'Member' AND T2.major_name LIKE '%Education%' AND T2.college = 'College of Education & Human Services' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
How many members have education major in the College of Education & Human Services? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,441 | moderate |
What is the percentage of the events that went over budget? | SELECT CAST(SUM(CASE WHEN remaining < 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(budget_id) FROM budget | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the percentage of the events that went over budget? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,442 | simple |
Give the event ID, location, and status of events conducted from November 2019 to March 2020. | SELECT event_id, location, status FROM event WHERE date(SUBSTR(event_date, 1, 10)) BETWEEN '2019-11-01' AND '2020-03-31' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Give the event ID, location, and status of events conducted from November 2019 to March 2020. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,443 | simple |
List the expenses that spend more than fifty dollars on average. | SELECT expense_description FROM expense GROUP BY expense_description HAVING AVG(cost) > 50 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the expenses that spend more than fifty dollars on average. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,444 | simple |
Find the full name of members whose t-shirt size is extra large. | SELECT first_name, last_name FROM member WHERE t_shirt_size = 'X-Large' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Find the full name of members whose t-shirt size is extra large. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,445 | simple |
Calculate the percentage of zip codes that are PO boxes. | SELECT CAST(SUM(CASE WHEN type = 'PO box' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(zip_code) FROM zip_code | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the percentage of zip codes that are PO boxes. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,446 | simple |
List the name and location of events that underspend its budget. | SELECT DISTINCT T1.event_name, T1.location FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.remaining > 0 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the name and location of events that underspend its budget. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,447 | simple |
Find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars. | SELECT T1.event_name, T1.event_date FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T3.expense_description = 'Pizza' AND T3.cost > 50 AND T3.cost < 100 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,448 | challenging |
What is the name and major of members who had to spend more than a hundred dollars on an expense? | SELECT DISTINCT T1.first_name, T1.last_name, T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major INNER JOIN expense AS T3 ON T1.member_id = T3.link_to_member WHERE T3.cost > 100 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the name and major of members who had to spend more than a hundred dollars on an expense? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,449 | moderate |
In the events with more than forty incomes, list the city and country in which the event is happening. | SELECT DISTINCT T3.city, T3.county FROM income AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN zip_code AS T3 ON T3.zip_code = T2.zip WHERE T1.amount > 40 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
In the events with more than forty incomes, list the city and country in which the event is happening. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,450 | simple |
Among the members who incurred expenses in more than one event, who paid the most amount? | SELECT T2.member_id FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN budget AS T3 ON T1.link_to_budget = T3.budget_id INNER JOIN event AS T4 ON T3.link_to_event = T4.event_id GROUP BY T2.member_id HAVING COUNT(DISTINCT T4.event_id) > 1 ORDER BY SUM(T1.cost) DESC LIMIT 1 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Among the members who incurred expenses in more than one event, who paid the most amount? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,451 | challenging |
What is the average amount paid by students in a position other than a member? | SELECT AVG(T1.cost) FROM expense AS T1 INNER JOIN member as T2 ON T1.link_to_member = T2.member_id WHERE T2.position != 'Member' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the average amount paid by students in a position other than a member? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,452 | moderate |
List the name of events with less than average parking cost. | SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T2.category = 'Parking' AND T3.cost < (SELECT AVG(cost) FROM expense) | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the name of events with less than average parking cost. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,453 | moderate |
What is the percentage of the cost for the game events? | SELECT SUM(CASE WHEN T1.type = 'Game' THEN T3.cost ELSE 0 END) * 100 / SUM(T3.cost) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the percentage of the cost for the game events? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,454 | moderate |
Which budget allowed the most money for water, chips, and cookies? | SELECT T2.budget_id FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id WHERE T1.expense_description = 'Water, chips, cookies' ORDER BY T1.cost DESC LIMIT 1 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Which budget allowed the most money for water, chips, and cookies? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,455 | moderate |
List the full name of the top five members who spend the most money in the descending order of spending. | SELECT T3.first_name, T3.last_name FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id ORDER BY T2.spent DESC LIMIT 5 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the full name of the top five members who spend the most money in the descending order of spending. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,456 | moderate |
Give the full name and contact number of members who had to spend more than average on each expense. | SELECT DISTINCT T3.first_name, T3.last_name, T3.phone FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id INNER JOIN member AS T3 ON T3.member_id = T1.link_to_member WHERE T1.cost > ( SELECT AVG(T1.cost) FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id INNER JOIN member AS T3 ON T3.member_id = T1.link_to_member ) | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Give the full name and contact number of members who had to spend more than average on each expense. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,457 | challenging |
Calculate the difference in the percentage of members in Maine and Vermont. | SELECT CAST((SUM(CASE WHEN T2.state = 'Maine' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.state = 'Vermont' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.member_id) AS diff FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the difference in the percentage of members in Maine and Vermont. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,458 | moderate |
What is the major of Garrett Gerke and which department does it belong to? | SELECT T2.major_name, T2.department FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.first_name = 'Garrett' AND T1.last_name = 'Gerke' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What is the major of Garrett Gerke and which department does it belong to? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,459 | simple |
Write the full name of the member who spent money for water, veggie tray and supplies and include the cost of it. | SELECT T2.first_name, T2.last_name, T1.cost FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id WHERE T1.expense_description = 'Water, Veggie tray, supplies' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Write the full name of the member who spent money for water, veggie tray and supplies and include the cost of it. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,460 | challenging |
List the last names of students under the Elementary Education major and include their phone numbers. | SELECT T1.last_name, T1.phone FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T2.major_name = 'Elementary Education' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the last names of students under the Elementary Education major and include their phone numbers. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,461 | simple |
What category was budgeted for the 'January Speaker' event and how much was the amount budgeted for that category? | SELECT T2.category, T2.amount FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'January Speaker' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
What category was budgeted for the 'January Speaker' event and how much was the amount budgeted for that category? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,462 | simple |
List the event names which were budgeted for the food. | SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.category = 'Food' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
List the event names which were budgeted for the food. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,463 | simple |
Write the full names of students who received funds on the date of 9/9/2019 and include the amount received. | SELECT DISTINCT T3.first_name, T3.last_name, T4.amount FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T3.member_id = T2.link_to_member INNER JOIN income AS T4 ON T4.link_to_member = T3.member_id WHERE T4.date_received = '2019-09-09' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Write the full names of students who received funds on the date of 9/9/2019 and include the amount received. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,464 | challenging |
Which budget category does the expense 'Posters' fall to? | SELECT DISTINCT T2.category FROM expense AS T1 INNER JOIN budget AS T2 ON T1.link_to_budget = T2.budget_id WHERE T1.expense_description = 'Posters' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Which budget category does the expense 'Posters' fall to? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,465 | simple |
Write the full name of the club member with the position of 'Secretary' and list which college the club member belongs to. | SELECT T1.first_name, T1.last_name, college FROM member AS T1 INNER JOIN major AS T2 ON T2.major_id = T1.link_to_major WHERE T1.position = 'Secretary' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Write the full name of the club member with the position of 'Secretary' and list which college the club member belongs to. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,466 | simple |
Calculate the total amount spent on speaker gifts and list the name of the event they were spent on. | SELECT SUM(T1.spent), T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T1.category = 'Speaker Gifts' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Calculate the total amount spent on speaker gifts and list the name of the event they were spent on. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,467 | simple |
Where is the hometown of Garrett Girke? | SELECT T2.city FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip WHERE T1.first_name = 'Garrett' AND T1.last_name = 'Gerke' | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Where is the hometown of Garrett Girke? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,468 | simple |
Which student has the hometown of Lincolnton, North Carolina with the zip code of 28092? List their full name and position. | SELECT T1.first_name, T1.last_name, T1.position FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip WHERE T2.city = 'Lincolnton' AND T2.state = 'North Carolina' AND T2.zip_code = 28092 | student_club | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#attendance (link_to_event text, link_to_member text, , PRIMARY KEY(link_to_event), PRIMARY KEY(link_to_member), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#budget (budget_id text, category text, spent real, remaining real, amount integer, event_status text, link_to_event text, , PRIMARY KEY(budget_id), FOREIGN KEY(link_to_event) REFERENCES event(event_id))
#event (event_id text, event_name text, event_date text, type text, notes text, location text, status text, , PRIMARY KEY(event_id), )
#expense (expense_id text, expense_description text, expense_date text, cost real, approved text, link_to_member text, link_to_budget text, , PRIMARY KEY(expense_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id), FOREIGN KEY(link_to_budget) REFERENCES budget(budget_id))
#income (income_id text, date_received text, amount integer, source text, notes text, link_to_member text, , PRIMARY KEY(income_id), FOREIGN KEY(link_to_member) REFERENCES member(member_id))
#major (major_id text, major_name text, department text, college text, , PRIMARY KEY(major_id), )
#member (member_id text, first_name text, last_name text, email text, position text, t_shirt_size text, phone text, zip integer, link_to_major text, , PRIMARY KEY(member_id), FOREIGN KEY(link_to_major) REFERENCES major(major_id), FOREIGN KEY(zip) REFERENCES zip_code(zip_code))
#zip_code (zip_code integer, type text, city text, county text, state text, short_state text, , PRIMARY KEY(zip_code), )
#
Which student has the hometown of Lincolnton, North Carolina with the zip code of 28092? List their full name and position. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,469 | moderate |
How many gas stations in CZE has Premium gas? | SELECT COUNT(GasStationID) FROM gasstations WHERE Country = 'CZE' AND Segment = 'Premium' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How many gas stations in CZE has Premium gas? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,470 | simple |
What is the ratio of costumers who pay in EUR against customers who pay in CZK? | SELECT CAST(SUM(IIF(Currency = 'EUR', 1, 0)) AS FLOAT) / SUM(IIF(Currency = 'CZK', 1, 0)) FROM customers | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What is the ratio of costumers who pay in EUR against customers who pay in CZK? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,471 | simple |
In 2012, who had the least consumption in LAM? | SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' AND T2.date BETWEEN 201201 AND 201212 GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
In 2012, who had the least consumption in LAM? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,472 | moderate |
What was the average monthly consumption of customers in SME for the year 2013? | SELECT AVG(T2.Consumption) / 12 FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE SUBSTRING(T2.Date, 1, 4) = '2013' AND T1.Segment = 'SME' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What was the average monthly consumption of customers in SME for the year 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,473 | moderate |
Which customers, paying in CZK, consumed the most gas in 2011? | SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'CZK' AND T2.Date BETWEEN 201101 AND 201112 GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which customers, paying in CZK, consumed the most gas in 2011? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,474 | moderate |
How many customers in KAM had a consumption of less than 30,000 for the year 2012? | SELECT COUNT(*) FROM ( SELECT T2.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'KAM' AND SUBSTRING(T2.Date, 1, 4) = '2012' GROUP BY T2.CustomerID HAVING SUM(T2.Consumption) < 30000 ) AS t1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How many customers in KAM had a consumption of less than 30,000 for the year 2012? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,475 | moderate |
What was the difference in gas consumption between CZK-paying customers and EUR-paying customers in 2012? | SELECT SUM(IIF(T1.Currency = 'CZK', T2.Consumption, 0)) - SUM(IIF(T1.Currency = 'EUR', T2.Consumption, 0)) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE SUBSTRING(T2.Date, 1, 4) = '2012' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What was the difference in gas consumption between CZK-paying customers and EUR-paying customers in 2012? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,476 | challenging |
Which year recorded the most gas use paid in EUR? | SELECT SUBSTRING(T2.Date, 1, 4) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'EUR' GROUP BY SUBSTRING(T2.Date, 1, 4) ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which year recorded the most gas use paid in EUR? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,477 | simple |
Which segment had the least consumption? | SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Segment ORDER BY SUM(T2.Consumption) ASC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which segment had the least consumption? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,478 | simple |
Which year recorded the most consumption of gas paid in CZK? | SELECT SUBSTRING(T2.Date, 1, 4) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'CZK' GROUP BY SUBSTRING(T2.Date, 1, 4) ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which year recorded the most consumption of gas paid in CZK? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,479 | moderate |
What was the gas consumption peak month for SME customers in 2013? | SELECT SUBSTRING(T2.Date, 5, 2) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE SUBSTRING(T2.Date, 1, 4) = '2013' AND T1.Segment = 'SME' GROUP BY SUBSTRING(T2.Date, 5, 2) ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What was the gas consumption peak month for SME customers in 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,480 | moderate |
What is the difference in the annual average consumption of the customers with the least amount of consumption paid in CZK for 2013 between SME and LAM, LAM and KAM, and KAM and SME? | SELECT CAST(SUM(IIF(T1.Segment = 'SME', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'LAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) , CAST(SUM(IIF(T1.Segment = 'LAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'KAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) , CAST(SUM(IIF(T1.Segment = 'KAM', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) - CAST(SUM(IIF(T1.Segment = 'SME', T2.Consumption, 0)) AS FLOAT) / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'CZK' AND T2.Consumption = ( SELECT MIN(Consumption) FROM yearmonth ) AND T2.Date BETWEEN 201301 AND 201312 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What is the difference in the annual average consumption of the customers with the least amount of consumption paid in CZK for 2013 between SME and LAM, LAM and KAM, and KAM and SME? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,481 | challenging |
Which of the three segments—SME, LAM and KAM—has the biggest and lowest percentage increases in consumption paid in EUR between 2012 and 2013? | SELECT CAST((SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2012%', T2.Consumption, 0))) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'SME' AND T2.Date LIKE '2012%', T2.Consumption, 0)), CAST(SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'LAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) , CAST(SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2013%', T2.Consumption, 0)) - SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) AS FLOAT) * 100 / SUM(IIF(T1.Segment = 'KAM' AND T2.Date LIKE '2012%', T2.Consumption, 0)) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which of the three segments—SME, LAM and KAM—has the biggest and lowest percentage increases in consumption paid in EUR between 2012 and 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,482 | challenging |
How much did customer 6 consume in total between August and November 2013? | SELECT SUM(Consumption) FROM yearmonth WHERE CustomerID = 6 AND Date BETWEEN '201308' AND '201311' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How much did customer 6 consume in total between August and November 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,483 | simple |
How many more "discount" gas stations does the Czech Republic have compared to Slovakia? | SELECT SUM(IIF(Country = 'CZE', 1, 0)) - SUM(IIF(Country = 'SVK', 1, 0)) FROM gasstations WHERE Segment = 'Discount' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How many more "discount" gas stations does the Czech Republic have compared to Slovakia? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,484 | simple |
How much more was customer 7 consuming in April 2013 than customer 5? | SELECT SUM(IIF(CustomerID = 7, Consumption, 0)) - SUM(IIF(CustomerID = 5, Consumption, 0)) FROM yearmonth WHERE Date = '201304' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How much more was customer 7 consuming in April 2013 than customer 5? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,485 | simple |
Is it true that more SMEs pay in Czech koruna than in euros? If so, how many more? | SELECT SUM(Currency = 'CZK') - SUM(Currency = 'EUR') FROM customers WHERE Segment = 'SME' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Is it true that more SMEs pay in Czech koruna than in euros? If so, how many more? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,486 | simple |
Which LAM customer used the Euro as their currency and had the highest consumption in October 2013? | SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' AND T2.Date = '201310' AND T1.Currency = 'EUR' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which LAM customer used the Euro as their currency and had the highest consumption in October 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,487 | moderate |
Who among KAM's customers consumed the most? How much did it consume? | SELECT T2.CustomerID, SUM(T2.Consumption) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'KAM' GROUP BY T2.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Who among KAM's customers consumed the most? How much did it consume? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,488 | simple |
How much did the KAM customers consume in total in May 2013? | SELECT SUM(T2.Consumption) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201305' AND T1.Segment = 'KAM' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How much did the KAM customers consume in total in May 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,489 | simple |
How many percent of LAM customer consumed more than 46.73? | SELECT CAST(SUM(IIF(T2.Consumption > 46.73, 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
How many percent of LAM customer consumed more than 46.73? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,490 | moderate |
Which country has more "value for money" gas stations? Please give a total number of "value for money" gas stations in each country. | SELECT Country , ( SELECT COUNT(GasStationID) FROM gasstations WHERE Segment = 'Value for money' ) FROM gasstations WHERE Segment = 'Value for money' GROUP BY Country ORDER BY COUNT(GasStationID) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which country has more "value for money" gas stations? Please give a total number of "value for money" gas stations in each country. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,491 | simple |
What percentage of KAM customers pay in euros? | SELECT CAST(SUM(Currency = 'EUR') AS FLOAT) * 100 / COUNT(CustomerID) FROM customers WHERE Segment = 'KAM' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What percentage of KAM customers pay in euros? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,492 | simple |
In February 2012, what percentage of customers consumed more than 528.3? | SELECT CAST(SUM(IIF(Consumption > 528.3, 1, 0)) AS FLOAT) * 100 / COUNT(CustomerID) FROM yearmonth WHERE Date = '201202' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
In February 2012, what percentage of customers consumed more than 528.3? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,493 | simple |
What percentage of Slovakian gas stations are premium? | SELECT CAST(SUM(IIF(Segment = 'Premium', 1, 0)) AS FLOAT) * 100 / COUNT(GasStationID) FROM gasstations WHERE Country = 'SVK' | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What percentage of Slovakian gas stations are premium? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,494 | simple |
Which client ID consumed the most in September 2013? | SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201309' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which client ID consumed the most in September 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,495 | simple |
Which client segment consumed the least in September 2013? | SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201309' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which client segment consumed the least in September 2013? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,496 | simple |
Which SME customer consumed the least in June 2012? | SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Date = '201206' AND T1.Segment = 'SME' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
Which SME customer consumed the least in June 2012? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,497 | simple |
What is the highest monthly consumption in the year 2012? | SELECT SUM(Consumption) FROM yearmonth WHERE SUBSTRING(Date, 1, 4) = '2012' GROUP BY SUBSTRING(Date, 5, 2) ORDER BY SUM(Consumption) DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What is the highest monthly consumption in the year 2012? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,498 | simple |
What is the biggest monthly consumption of the customers who use euro as their currency? | SELECT SUM(T2.Consumption) / 12 AS MonthlyConsumption FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'EUR' GROUP BY T1.CustomerID ORDER BY MonthlyConsumption DESC LIMIT 1 | debit_card_specializing | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#customers (CustomerID integer, Segment text, Currency text, , PRIMARY KEY(CustomerID), )
#gasstations (GasStationID integer, ChainID integer, Country text, Segment text, , PRIMARY KEY(GasStationID), )
#products (ProductID integer, Description text, , PRIMARY KEY(ProductID), )
#transactions_1k (TransactionID integer, Date date, Time text, CustomerID integer, CardID integer, GasStationID integer, ProductID integer, Amount integer, Price real, , PRIMARY KEY(TransactionID), )
#yearmonth (CustomerID integer, Date text, Consumption real, , PRIMARY KEY(Date), PRIMARY KEY(CustomerID), FOREIGN KEY(CustomerID) REFERENCES customers(CustomerID))
#
What is the biggest monthly consumption of the customers who use euro as their currency? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 1,499 | simple |