SQL
stringlengths
29
1.45k
difficulty
stringclasses
3 values
question_id
int64
0
1.53k
db_id
stringclasses
11 values
evidence
stringlengths
0
591
question
stringlengths
23
286
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
1,400
student_club
DIVIDE(SUM(type = 'Community Service'), COUNT(event_id)) * 100 where event_date BETWEEN' 2019-01-01' and '2019-12-31'
Among all events hold by the Student_Club in 2019, find the percentage share of events related to 'Community Service'
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
1,401
student_club
'Posters' is the expense description; 'September Speaker' is an event name
Indicate the cost of posters for 'September Speaker' event.
SELECT t_shirt_size FROM member GROUP BY t_shirt_size ORDER BY COUNT(t_shirt_size) DESC LIMIT 1
simple
1,402
student_club
most popular size of t-shirt ordered refers to MAX(COUNT(t_shirt_size))
What is the most popular size of t-shirt ordered by the club members?
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
1,403
student_club
closed events refers to event_name where status = 'Closed'; exceed the budget the most refers to MIN(remaining) where remaining < 0
Indicate the name of the closed event whose cost has exceeded the budget the most.
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
1,404
student_club
total value refers to SUM(cost); 'October Meeting' is an event name;
Identify the type of expenses and their total value approved for 'October Meeting' event.
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
1,405
student_club
'April Speaker' is an event name; amount budgeted refers to budget; budget categories refers to category
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 budget_id FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget )
simple
1,406
student_club
MAX(amount) where category = 'Food'
Among the budgets for Food, which one has the highest budgeted amount?
SELECT budget_id FROM budget WHERE category = 'Advertisement' ORDER BY amount DESC LIMIT 3
simple
1,407
student_club
MAX(amount) where category = 'Advertisement'
Among the budgets for Advertising, list out top three which have the most budgeted amount?
SELECT SUM(cost) FROM expense WHERE expense_description = 'Parking'
simple
1,408
student_club
total cost spent for Parking refers to SUM(cost) where expense_description = 'Parking'
Calculate the total cost spent for Parking in the list.
SELECT SUM(cost) FROM expense WHERE expense_date = '2019-08-20'
simple
1,409
student_club
total expense refers SUM(cost) where expense_date = '2019-08-20'
Mention the total expense used on 8/20/2019.
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
1,410
student_club
full name refers to first_name, last name
List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" 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
1,411
student_club
kind of expenses refers to expense_description
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.t_shirt_size = 'X-Large'
simple
1,412
student_club
kind of expenses refers to expense_description; t_shirt_size = 'X-Large'
What kind of expenses incurred by members who have X-Large in size of tee shirt?
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
1,413
student_club
incurred less than 50USD refers to cost < 50
Mention the zip code of member who incurred less than 50USD.
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
1,414
student_club
name of major refers to major_name
State the name of major that Phillip Cullen has joined.
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
1,415
student_club
'Business' is the major name
List out the position of members who joined major of Business.
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
1,416
student_club
members of Economics refers to major_name = 'Business'; t_shirt_size = 'Medium'
How many members of Business have the Medium size of tee shirt?
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
1,417
student_club
remaining budget more than 30 USD refers to remaining > 30
List out the type of events which have remaining budget more than 30 USD.
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
1,418
student_club
held at MU 215 refers to location = 'MU 215'
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.event_date = '2020-03-24T12:00:00'
simple
1,419
student_club
taken place in 2020-03-24T12:00:00 refers to event_date = '2020-03-24T12:00:00'
What is the category of event which was taken place in 2020-03-24T12:00:00?
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
1,420
student_club
name of major refers to major_name; 'Vice President' is position of Student Club
State the name of major that Vice President has joined.
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
1,421
student_club
DIVIDE(SUM(position = 'Member' and major_name = 'Mathematics'), COUNT(member_id)) * 100
Calculate the percentage of members who are major Mathematics in the list?
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
1,422
student_club
'MU 215' is the location of event
State the category of events were held at MU 215.
SELECT COUNT(income_id) FROM income WHERE amount = 50
simple
1,423
student_club
amount of 50 refers to amount = 50
How many income are received with an amount of 50?
SELECT COUNT(member_id) FROM member WHERE position = 'Member' AND t_shirt_size = 'X-Large'
simple
1,424
student_club
among the members refers to position = 'Member'; extra large t-shirt size refers to t_shirt_size = 'X-Large'
Among the members, how many of them have an extra large t-shirt size?
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,425
student_club
In the College of Agriculture and Applied Sciences, how many majors are under the department of School of Applied Sciences, Technology and Education?
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
1,426
student_club
'Environmental Engineering' is the major name;
List the last name of members with a major in environmental engineering and include its department and college name.
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
1,427
student_club
budget category refers to category; events located at refers to location; type = 'Guest Speaker'; 0 budget spent refers to spent = 0
What are the budget category of the events located at MU 215 and a guest speaker type with a 0 budget spent?
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
1,428
student_club
'Electrical and Computer Engineering Department' is the department; members enrolled refers to position = 'Member'
List the city and state of members enrolled under electrical and computer engineering department.
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
1,429
student_club
name of social event refers to event_name where type = 'Social'; 'Vice President' is position; located at refers to location
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 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
1,430
student_club
bought pizza on 09/10/2019 refers to expense_description = 'Pizza' where expense_date = '2019-09-10'
What is the last name and position of the student that bought pizza on 09/10/2019?
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
1,431
student_club
members of the club refers to position = 'Member'; 'Women's Soccer' is event name;
List the last name of the members of the club that attended the women's soccer event.
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
1,432
student_club
t_shirt_size = 'Medium' where position = 'Member'; percentage = DIVIDE(COUNT(amount = 50), COUNT(member_id)) * 100
Among the members with t-shirt size of medium, what is the percentage of the amount 50 received by the Student_Club?
SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL
simple
1,433
student_club
zip codes that have post office boxes refers to type = 'PO Box'
Which countries have zip codes with post office boxes?
SELECT zip_code FROM zip_code WHERE type = 'PO Box' AND county = 'San Juan Municipio' AND state = 'Puerto Rico'
simple
1,434
student_club
zip codes that have post office boxes refers to type = 'PO Box'
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 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
1,435
student_club
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'
List the names of closed event as "game" that was closed from 3/15/2019 to 3/20/2020.
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
1,436
student_club
have paid more than 50 dollar refers to cost > 50
Please provide links to events for members who have paid more than 50 dollar.
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
1,437
student_club
approved from 1/10/2019 to 11/19/2019 refers to approved = 'true' and expense_date BETWEEN '2019-01-10' and '2019-11-19'
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 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,438
student_club
Please indicate the college of the person whose first name is Katy with the link to the major "rec1N0upiVLy5esTO".
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
1,439
student_club
'College of Agriculture and Applied Sciences' is the college; majored in business refers to major_name = 'Business'; phone numbers refers to phone
Please list the phone numbers of the members who majored in business at the College of Agriculture and Applied Sciences.
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
1,440
student_club
expense_date BETWEEN '2019-09-10' and '2019-11-19'; cost > 20
List emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019.
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
1,441
student_club
'education' is the major name; 'Member' is a position of club;
How many members have education major in the College of Education & Human Services?
SELECT CAST(SUM(CASE WHEN remaining < 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(budget_id) FROM budget
simple
1,442
student_club
went over budget refers to remaining < 0; percentage = DIVIDE(SUM(remaining < 0), COUNT(event_id)) * 100
What is the percentage of the events that went over budget?
SELECT event_id, location, status FROM event WHERE date(SUBSTR(event_date, 1, 10)) BETWEEN '2019-11-01' AND '2020-03-31'
simple
1,443
student_club
event_date BETWEEN '2019-11-01' and '2020-03-31'
Give the event ID, location, and status of events conducted from November 2019 to March 2020.
SELECT expense_description FROM expense GROUP BY expense_description HAVING AVG(cost) > 50
simple
1,444
student_club
expense refers to expense_description; spend more than fifty dollars on average refers to DIVIDE( SUM(cost), COUNT(expense_id) ) > 50
List the expenses that spend more than fifty dollars on average.
SELECT first_name, last_name FROM member WHERE t_shirt_size = 'X-Large'
simple
1,445
student_club
full name refers to first_name, last_name; t_shirt_size = 'X-Large'
Find the full name of members whose t-shirt size is extra large.
SELECT CAST(SUM(CASE WHEN type = 'PO box' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(zip_code) FROM zip_code
simple
1,446
student_club
DIVIDE(SUM(type = 'PO Box'), COUNT(zip_code)) * 100
Calculate the percentage of zip codes that are PO boxes.
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
1,447
student_club
name of event refers to event_name; underspend its budget refers to remaining > 0
List the name and location of events that underspend its budget.
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
1,448
student_club
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
Find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars.
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
1,449
student_club
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
What is the name and major of members who had to spend more than a hundred dollars on an expense?
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
1,450
student_club
more than fifty incomes refers to income > 40
In the events with more than forty incomes, list the city and country in which the event is happening.
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
1,451
student_club
paid the most amount refers to for expense incurred in more than one event refers to MAX(cost where COUNT(event_id) > 1)
Among the members who incurred expenses in more than one event, who paid the most amount?
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
1,452
student_club
position other than a member refers to position ! = 'Member'; average amount paid = DIVIDE( SUM(cost), COUNT(event_id))
What is the average amount paid by students in a position other than a member?
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
1,453
student_club
name of events refers to event_name; less than average parking cost refers to cost < DIVIDE(SUM(cost), COUNT(event_id)) where category = 'Parking'
List the name of events with less than average parking cost.
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
1,454
student_club
game events refers to type = 'Game'; percentage = DIVIDE( SUM(cost), COUNT(event_id)) * 100
What is the percentage of the cost for the game events?
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
1,455
student_club
budget allowed refers to expense_description; expense_description = 'Water, chips, cookies'; most money refers to MAX(cost)
Which budget allowed the most money for water, chips, and cookies?
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
1,456
student_club
full name refers to first_name, last_name; spend the most money refers to MAX(expense.cost)
List the full name of the top five members who spend the most money in the descending order of spending.
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
1,457
student_club
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)
Give the full name and contact number of members who had to spend more than average on each expense.
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
1,458
student_club
SUBTRACT( DIVIDE( SUM(state = 'Maine'), COUNT(position = 'Member')), DIVIDE( SUM(state = 'Vermont'), COUNT(position = 'Member')) )
Calculate the difference in the percentage of members in Maine and Vermont.
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
1,459
student_club
major refers to major name;
What is the major of Garrett Gerke and which department does it belong to?
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
1,460
student_club
full name refers to first_name, last name; spent money for refers expense description; expense_description = 'Water, Veggie tray, supplies'
Write the full name of the member who spent money for water, veggie tray and supplies and include the cost of it.
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
1,461
student_club
'Elementary Education' is the major name; phone numbers refers to phone
List the last names of students under the Elementary Education major and include their phone numbers.
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
1,462
student_club
amount budgeted refers to amount, 'January Speaker' is the event name;
What category was budgeted for the 'January Speaker' event and how much was the amount budgeted for that category?
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
1,463
student_club
budgeted for food refers to category = 'Food'
List the event names which were budgeted for the food.
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
1,464
student_club
full name refers to first_name, last_name, amount of funds received refers to amount, received funds on date refers to date_received
Write the full names of students who received funds on the date of 9/9/2019 and include the amount received.
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
1,465
student_club
'Posters' refers to expense description
Which budget category does the expense 'Posters' fall 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
1,466
student_club
full name refers to first_name, last name
Write the full name of the club member with the position of 'Secretary' and list which college the club member belongs to.
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
1,467
student_club
total amount spent = SUM(spent) where category = 'Speaker Gifts'
Calculate the total amount spent on speaker gifts and list the name of the event they were spent on.
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
1,468
student_club
hometown refers to city
Where is the hometown of Garrett Girke?
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
1,469
student_club
full name refers to first_name, last_name, hometown of Lincolnton, North Carolina refers to city = 'Lincolnton' AND state = 'North Carolina'
Which student has the hometown of Lincolnton, North Carolina with the zip code of 28092? List their full name and position.
SELECT COUNT(GasStationID) FROM gasstations WHERE Country = 'CZE' AND Segment = 'Premium'
simple
1,470
debit_card_specializing
How many gas stations in CZE has Premium gas?
SELECT CAST(SUM(IIF(Currency = 'EUR', 1, 0)) AS FLOAT) / SUM(IIF(Currency = 'CZK', 1, 0)) FROM customers
simple
1,471
debit_card_specializing
ratio of costumers who pay in EUR against customers who pay in CZK = count(Currency = 'EUR') / count(Currency = 'CZK').
What is the ratio of costumers who pay in EUR against customers who pay in CZK?
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
1,472
debit_card_specializing
Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012
In 2012, who had the least consumption in LAM?
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
1,473
debit_card_specializing
Average Monthly consumption = AVG(Consumption) / 12; Year 2013 can be presented as Between 201301 And 201312, which means between January and December in 2013
What was the average monthly consumption of customers in SME for the year 2013?
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
1,474
debit_card_specializing
Year 2011 can be presented as Between 201101 And 201112, which means between January and December in 2011
Which customers, paying in CZK, consumed the most gas in 2011?
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
1,475
debit_card_specializing
Year 2012 can be presented as Between 201201 And 201212, which means between January and December in 2012
How many customers in KAM had a consumption of less than 30,000 for the year 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
1,476
debit_card_specializing
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
What was the difference in gas consumption between CZK-paying customers and EUR-paying customers in 2012?
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,477
debit_card_specializing
Which year recorded the most gas use paid in EUR?
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,478
debit_card_specializing
Which segment had the least consumption?
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
1,479
debit_card_specializing
The first 4 strings of the values in the table yearmonth can represent year.
Which year recorded the most consumption of gas paid in CZK?
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
1,480
debit_card_specializing
'in 2013' refers to the first 4 strings of yearmonth.date = '2013', The 5th and 6th string of the date can refer to month.
What was the gas consumption peak month for SME customers in 2013?
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
1,481
debit_card_specializing
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.
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' 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
1,482
debit_card_specializing
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.
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 SUM(Consumption) FROM yearmonth WHERE CustomerID = 6 AND Date BETWEEN '201308' AND '201311'
simple
1,483
debit_card_specializing
Between August And November 2013 refers to Between 201308 And 201311; First 4 strings of Date represents the year.
How much did customer 6 consume in total between August and November 2013?
SELECT SUM(IIF(Country = 'CZE', 1, 0)) - SUM(IIF(Country = 'SVK', 1, 0)) FROM gasstations WHERE Segment = 'Discount'
simple
1,484
debit_card_specializing
Computation of more discount = Total no. of discount gas stations in Czech Republic - Total no. of discount gas stations in Slovakia
How many more "discount" gas stations does the Czech Republic have compared to Slovakia?
SELECT SUM(IIF(CustomerID = 7, Consumption, 0)) - SUM(IIF(CustomerID = 5, Consumption, 0)) FROM yearmonth WHERE Date = '201304'
simple
1,485
debit_card_specializing
April 2013 refers to 201304 in the yearmonth.date
How much more was customer 7 consuming in April 2013 than customer 5?
SELECT SUM(Currency = 'CZK') - SUM(Currency = 'EUR') FROM customers WHERE Segment = 'SME'
simple
1,486
debit_card_specializing
Amount of more SMEs = Total of SMEs uses Czech Koruna - Total of SMEs uses Euro
Is it true that more SMEs pay in Czech koruna than in euros? If so, how many more?
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
1,487
debit_card_specializing
October 2013 refers to 201310 in the yearmonth.date
Which LAM customer used the Euro as their currency and had the highest consumption in October 2013?
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,488
debit_card_specializing
Who among KAM's customers consumed the most? How much did it consume?
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
1,489
debit_card_specializing
May 2013 refers to yearmonth.date = 201305
How much did the KAM customers consume in total in May 2013?
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
1,490
debit_card_specializing
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%.
How many percent of LAM customer consumed more than 46.73?
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,491
debit_card_specializing
Which country has more "value for money" gas stations? Please give a total number of "value for money" gas stations in each country.
SELECT CAST(SUM(Currency = 'EUR') AS FLOAT) * 100 / COUNT(CustomerID) FROM customers WHERE Segment = 'KAM'
simple
1,492
debit_card_specializing
Percentage of KAM uses Euro = (Total of KAM uses Euro / Total of KAM) * 100%.
What percentage of KAM customers pay in euros?
SELECT CAST(SUM(IIF(Consumption > 528.3, 1, 0)) AS FLOAT) * 100 / COUNT(CustomerID) FROM yearmonth WHERE Date = '201202'
simple
1,493
debit_card_specializing
February 2012 refers to '201202' in yearmonth.date
In February 2012, what percentage of customers consumed more than 528.3?
SELECT CAST(SUM(IIF(Segment = 'Premium', 1, 0)) AS FLOAT) * 100 / COUNT(GasStationID) FROM gasstations WHERE Country = 'SVK'
simple
1,494
debit_card_specializing
Percentage of premium gas station = (Total of premium gas station in Slovakia / Total of gas station in Slovakia) * 100%.
What percentage of Slovakian gas stations are premium?
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
1,495
debit_card_specializing
September 2013 refers to yearmonth.date = '201309'
Which client ID consumed the most 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
1,496
debit_card_specializing
September 2013 refers to yearmonth.date = '201309'
Which client segment consumed the least in September 2013?
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
1,497
debit_card_specializing
June 2012 refers to yearmonth.date = '201206'
Which SME customer consumed the least in June 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
1,498
debit_card_specializing
The first 4 strings of yearmonth.date can represent the year.
What is the highest monthly consumption in the year 2012?
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
1,499
debit_card_specializing
Monthly consumption = SUM(consumption) / 12
What is the biggest monthly consumption of the customers who use euro as their currency?