query_id
int64 0
1.53k
| database_id
stringclasses 11
values | table_id
sequencelengths 1
4
| query
stringlengths 23
286
| answer
stringlengths 29
1.45k
| difficulty
stringclasses 3
values | evidence
stringlengths 0
591
|
---|---|---|---|---|---|---|
1,400 | student_club | [
"event"
] | 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' | moderate | DIVIDE(SUM(type = 'Community Service'), COUNT(event_id)) * 100 where event_date BETWEEN' 2019-01-01' and '2019-12-31' |
1,401 | student_club | [
"event",
"budget",
"expense"
] | 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' | moderate | 'Posters' is the expense description; 'September Speaker' is an event name |
1,402 | student_club | [
"member"
] | 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 | simple | most popular size of t-shirt ordered refers to MAX(COUNT(t_shirt_size)) |
1,403 | student_club | [
"event",
"budget"
] | 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 | moderate | closed events refers to event_name where status = 'Closed'; exceed the budget the most refers to MIN(remaining) where remaining < 0 |
1,404 | student_club | [
"event",
"budget",
"expense"
] | 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' | moderate | total value refers to SUM(cost); 'October Meeting' is an event name; |
1,405 | student_club | [
"event",
"budget"
] | 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 | moderate | 'April Speaker' is an event name; amount budgeted refers to budget; budget categories refers to category |
1,406 | student_club | [
"budget"
] | 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 ) | simple | MAX(amount) where category = 'Food' |
1,407 | student_club | [
"budget"
] | 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 | simple | MAX(amount) where category = 'Advertisement' |
1,408 | student_club | [
"expense"
] | Calculate the total cost spent for Parking in the list. | SELECT SUM(cost) FROM expense WHERE expense_description = 'Parking' | simple | total cost spent for Parking refers to SUM(cost) where expense_description = 'Parking' |
1,409 | student_club | [
"expense"
] | Mention the total expense used on 8/20/2019. | SELECT SUM(cost) FROM expense WHERE expense_date = '2019-08-20' | simple | total expense refers SUM(cost) where expense_date = '2019-08-20' |
1,410 | student_club | [
"member",
"expense"
] | 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' | simple | full name refers to first_name, last name |
1,411 | student_club | [
"member",
"expense"
] | 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' | simple | kind of expenses refers to expense_description |
1,412 | student_club | [
"member",
"expense"
] | 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' | simple | kind of expenses refers to expense_description; t_shirt_size = 'X-Large' |
1,413 | student_club | [
"member",
"expense"
] | 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 | simple | incurred less than 50USD refers to cost < 50 |
1,414 | student_club | [
"major",
"member"
] | 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' | simple | name of major refers to major_name |
1,415 | student_club | [
"major",
"member"
] | 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' | simple | 'Business' is the major name |
1,416 | student_club | [
"major",
"member"
] | 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' | simple | members of Economics refers to major_name = 'Business'; t_shirt_size = 'Medium' |
1,417 | student_club | [
"event",
"budget"
] | 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 | simple | remaining budget more than 30 USD refers to remaining > 30 |
1,418 | student_club | [
"event",
"budget"
] | 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' | simple | held at MU 215 refers to location = 'MU 215' |
1,419 | student_club | [
"event",
"budget"
] | 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' | simple | taken place in 2020-03-24T12:00:00 refers to event_date = '2020-03-24T12:00:00' |
1,420 | student_club | [
"major",
"member"
] | 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' | simple | name of major refers to major_name; 'Vice President' is position of Student Club |
1,421 | student_club | [
"major",
"member"
] | 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' | moderate | DIVIDE(SUM(position = 'Member' and major_name = 'Mathematics'), COUNT(member_id)) * 100 |
1,422 | student_club | [
"event",
"budget"
] | 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' | simple | 'MU 215' is the location of event |
1,423 | student_club | [
"income"
] | How many income are received with an amount of 50? | SELECT COUNT(income_id) FROM income WHERE amount = 50 | simple | amount of 50 refers to amount = 50 |
1,424 | student_club | [
"member"
] | 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' | simple | among the members refers to position = 'Member'; extra large t-shirt size refers to t_shirt_size = 'X-Large' |
1,425 | student_club | [
"major"
] | 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' | simple | |
1,426 | student_club | [
"major",
"member"
] | 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' | moderate | 'Environmental Engineering' is the major name; |
1,427 | student_club | [
"event",
"budget"
] | 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' | moderate | budget category refers to category; events located at refers to location; type = 'Guest Speaker'; 0 budget spent refers to spent = 0 |
1,428 | student_club | [
"zip_code",
"major",
"member"
] | 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' | moderate | 'Electrical and Computer Engineering Department' is the department; members enrolled refers to position = 'Member' |
1,429 | student_club | [
"member",
"attendance",
"event"
] | 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' | challenging | name of social event refers to event_name where type = 'Social'; 'Vice President' is position; located at refers to location |
1,430 | student_club | [
"member",
"expense"
] | 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' | moderate | bought pizza on 09/10/2019 refers to expense_description = 'Pizza' where expense_date = '2019-09-10' |
1,431 | student_club | [
"member",
"attendance",
"event"
] | 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' | moderate | members of the club refers to position = 'Member'; 'Women's Soccer' is event name; |
1,432 | student_club | [
"member",
"income"
] | 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' | moderate | t_shirt_size = 'Medium' where position = 'Member'; percentage = DIVIDE(COUNT(amount = 50), COUNT(member_id)) * 100 |
1,433 | student_club | [
"zip_code"
] | Which countries have zip codes with post office boxes? | SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL | simple | zip codes that have post office boxes refers to type = 'PO Box' |
1,434 | student_club | [
"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? | SELECT zip_code FROM zip_code WHERE type = 'PO Box' AND county = 'San Juan Municipio' AND state = 'Puerto Rico' | simple | zip codes that have post office boxes refers to type = 'PO Box' |
1,435 | student_club | [
"event"
] | 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' | moderate | name of events refers event_name; game event that was closed refers to type = 'Game' where status = 'Closed'; event_date BETWEEN '2019-03-15' and '2020-03-20' |
1,436 | student_club | [
"attendance",
"member",
"expense"
] | 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 | simple | have paid more than 50 dollar refers to cost > 50 |
1,437 | student_club | [
"attendance",
"member",
"expense"
] | 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' | challenging | approved from 1/10/2019 to 11/19/2019 refers to approved = 'true' and expense_date BETWEEN '2019-01-10' and '2019-11-19' |
1,438 | student_club | [
"major",
"member"
] | 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' | simple | |
1,439 | student_club | [
"major",
"member"
] | 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' | moderate | 'College of Agriculture and Applied Sciences' is the college; majored in business refers to major_name = 'Business'; phone numbers refers to phone |
1,440 | student_club | [
"member",
"expense"
] | 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 | moderate | expense_date BETWEEN '2019-09-10' and '2019-11-19'; cost > 20 |
1,441 | student_club | [
"major",
"member"
] | 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' | moderate | 'education' is the major name; 'Member' is a position of club; |
1,442 | student_club | [
"budget"
] | 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 | simple | went over budget refers to remaining < 0; percentage = DIVIDE(SUM(remaining < 0), COUNT(event_id)) * 100 |
1,443 | student_club | [
"event"
] | 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' | simple | event_date BETWEEN '2019-11-01' and '2020-03-31' |
1,444 | student_club | [
"expense"
] | List the expenses that spend more than fifty dollars on average. | SELECT expense_description FROM expense GROUP BY expense_description HAVING AVG(cost) > 50 | simple | expense refers to expense_description; spend more than fifty dollars on average refers to DIVIDE( SUM(cost), COUNT(expense_id) ) > 50 |
1,445 | student_club | [
"member"
] | 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' | simple | full name refers to first_name, last_name; t_shirt_size = 'X-Large' |
1,446 | student_club | [
"zip_code"
] | 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 | simple | DIVIDE(SUM(type = 'PO Box'), COUNT(zip_code)) * 100 |
1,447 | student_club | [
"event",
"budget"
] | 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 | simple | name of event refers to event_name; underspend its budget refers to remaining > 0 |
1,448 | student_club | [
"event",
"budget",
"expense"
] | 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 | challenging | name of event refers to event_name; date of event refers to event_date; expenses for pizza refers to expense_description = 'Pizza' where cost > 50 and cost < 100 |
1,449 | student_club | [
"major",
"member",
"expense"
] | 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 | moderate | full name refers to first_name, last_name; major of members refers to major_name; spend more than a hundred dollars on an expense refers to cost > 100 |
1,450 | student_club | [
"member",
"zip_code",
"income"
] | 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 | simple | more than fifty incomes refers to income > 40 |
1,451 | student_club | [
"member",
"budget",
"expense",
"event"
] | 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 | challenging | paid the most amount refers to for expense incurred in more than one event refers to MAX(cost where COUNT(event_id) > 1) |
1,452 | student_club | [
"member",
"expense"
] | 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' | moderate | position other than a member refers to position ! = 'Member'; average amount paid = DIVIDE( SUM(cost), COUNT(event_id)) |
1,453 | student_club | [
"event",
"budget",
"expense"
] | 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) | moderate | name of events refers to event_name; less than average parking cost refers to cost < DIVIDE(SUM(cost), COUNT(event_id)) where category = 'Parking' |
1,454 | student_club | [
"event",
"budget",
"expense"
] | 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 | moderate | game events refers to type = 'Game'; percentage = DIVIDE( SUM(cost), COUNT(event_id)) * 100 |
1,455 | student_club | [
"budget",
"expense"
] | 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 | moderate | budget allowed refers to expense_description; expense_description = 'Water, chips, cookies'; most money refers to MAX(cost) |
1,456 | student_club | [
"member",
"budget",
"expense"
] | 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 | moderate | full name refers to first_name, last_name; spend the most money refers to MAX(expense.cost) |
1,457 | student_club | [
"member",
"budget",
"expense"
] | 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 ) | challenging | full name refers to first_name, last_name; contact number refers to phone; had spent more than average on each expense refers to cost > AVG(cost) |
1,458 | student_club | [
"zip_code",
"member"
] | 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 | moderate | SUBTRACT( DIVIDE( SUM(state = 'Maine'), COUNT(position = 'Member')), DIVIDE( SUM(state = 'Vermont'), COUNT(position = 'Member')) ) |
1,459 | student_club | [
"major",
"member"
] | 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' | simple | major refers to major name; |
1,460 | student_club | [
"member",
"expense"
] | 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' | challenging | full name refers to first_name, last name; spent money for refers expense description; expense_description = 'Water, Veggie tray, supplies' |
1,461 | student_club | [
"major",
"member"
] | 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' | simple | 'Elementary Education' is the major name; phone numbers refers to phone |
1,462 | student_club | [
"event",
"budget"
] | 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' | simple | amount budgeted refers to amount, 'January Speaker' is the event name; |
1,463 | student_club | [
"event",
"budget"
] | 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' | simple | budgeted for food refers to category = 'Food' |
1,464 | student_club | [
"member",
"attendance",
"event",
"income"
] | 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' | challenging | full name refers to first_name, last_name, amount of funds received refers to amount, received funds on date refers to date_received |
1,465 | student_club | [
"budget",
"expense"
] | 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' | simple | 'Posters' refers to expense description |
1,466 | student_club | [
"major",
"member"
] | 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' | simple | full name refers to first_name, last name |
1,467 | student_club | [
"event",
"budget"
] | 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' | simple | total amount spent = SUM(spent) where category = 'Speaker Gifts' |
1,468 | student_club | [
"zip_code",
"member"
] | 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' | simple | hometown refers to city |
1,469 | student_club | [
"zip_code",
"member"
] | 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 | moderate | full name refers to first_name, last_name, hometown of Lincolnton, North Carolina refers to city = 'Lincolnton' AND state = 'North Carolina' |
1,470 | debit_card_specializing | [
"gasstations"
] | How many gas stations in CZE has Premium gas? | SELECT COUNT(GasStationID) FROM gasstations WHERE Country = 'CZE' AND Segment = 'Premium' | simple | |
1,471 | debit_card_specializing | [
"customers"
] | 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 | simple | ratio of costumers who pay in EUR against customers who pay in CZK = count(Currency = 'EUR') / count(Currency = 'CZK'). |
1,472 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012 |
1,473 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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' | moderate | Average Monthly consumption = AVG(Consumption) / 12; Year 2013 can be presented as Between 201301 And 201312, which means between January and December in 2013 |
1,474 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | Year 2011 can be presented as Between 201101 And 201112, which means between January and December in 2011 |
1,475 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012 |
1,476 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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' | challenging | Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012; Difference in Consumption = CZK customers consumption in 2012 - EUR customers consumption in 2012 |
1,477 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | |
1,478 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | |
1,479 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | The first 4 strings of the values in the table yearmonth can represent year. |
1,480 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | 'in 2013' refers to the first 4 strings of yearmonth.date = '2013', The 5th and 6th string of the date can refer to month. |
1,481 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | challenging | annual average consumption of customer with the lowest consumption in each segment = total consumption per year / the number of customer with lowest consumption in each segment; Difference in annual average = SME's annual average - LAM's annual average; Difference in annual average = LAM's annual average - KAM's annual average; Year 2013 can be presented as Between 201301 And 201312; First 4 strings of Date represents the year. |
1,482 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | challenging | Increase or Decrease = consumption for 2013 - consumption for 2012; Percentage of Increase = (Increase or Decrease / consumption for 2013) * 100%; Between 2012 And 2013 can be represented by Between 201201 And 201312; First 4 strings of Date represents the year. |
1,483 | debit_card_specializing | [
"yearmonth"
] | 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' | simple | Between August And November 2013 refers to Between 201308 And 201311; First 4 strings of Date represents the year. |
1,484 | debit_card_specializing | [
"gasstations"
] | 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' | simple | Computation of more discount = Total no. of discount gas stations in Czech Republic - Total no. of discount gas stations in Slovakia |
1,485 | debit_card_specializing | [
"yearmonth"
] | 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' | simple | April 2013 refers to 201304 in the yearmonth.date |
1,486 | debit_card_specializing | [
"customers"
] | 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' | simple | Amount of more SMEs = Total of SMEs uses Czech Koruna - Total of SMEs uses Euro |
1,487 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | moderate | October 2013 refers to 201310 in the yearmonth.date |
1,488 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | |
1,489 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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' | simple | May 2013 refers to yearmonth.date = 201305 |
1,490 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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' | moderate | Percentage of LAM customer consumed more than 46.73 = (Total no. of LAM customers who consumed more than 46.73 / Total no. of LAM customers) * 100%. |
1,491 | debit_card_specializing | [
"gasstations"
] | 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 | simple | |
1,492 | debit_card_specializing | [
"customers"
] | What percentage of KAM customers pay in euros? | SELECT CAST(SUM(Currency = 'EUR') AS FLOAT) * 100 / COUNT(CustomerID) FROM customers WHERE Segment = 'KAM' | simple | Percentage of KAM uses Euro = (Total of KAM uses Euro / Total of KAM) * 100%. |
1,493 | debit_card_specializing | [
"yearmonth"
] | 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' | simple | February 2012 refers to '201202' in yearmonth.date |
1,494 | debit_card_specializing | [
"gasstations"
] | 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' | simple | Percentage of premium gas station = (Total of premium gas station in Slovakia / Total of gas station in Slovakia) * 100%. |
1,495 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | September 2013 refers to yearmonth.date = '201309' |
1,496 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | September 2013 refers to yearmonth.date = '201309' |
1,497 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | June 2012 refers to yearmonth.date = '201206' |
1,498 | debit_card_specializing | [
"yearmonth"
] | 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 | simple | The first 4 strings of yearmonth.date can represent the year. |
1,499 | debit_card_specializing | [
"yearmonth",
"customers"
] | 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 | simple | Monthly consumption = SUM(consumption) / 12 |