birdsql/bird_sql_dev_20251106 huggingface dataset:
Database: student_club
Question: Among the events attended by more than 10 members of the Student_Club, how many of them are meetings?
Evidence: meetings events refers to type = 'Meeting'; attended by more than 10 members refers to COUNT(event_id) > 10
SQL:
SELECT COUNT(*) AS meeting_events_over_10
FROM event AS e
WHERE e.type = 'Meeting'
  AND (SELECT COUNT(*) 
       FROM attendance AS a 
       WHERE a.link_to_event = e.event_id) > 10;
Database: student_club
Question: List all the names of events that had an attendance of over 20 students but were not fundraisers.
Evidence: attendance of over 20 students means the event has more than 20 attendance records; fundraisers are events where type = 'Fundraiser'
SQL:
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.type != 'Fundraiser' GROUP BY T1.event_id HAVING COUNT(T2.link_to_event) > 20
Database: student_club
Question: What is the average attendance of meetings in 2020?
Evidence: meetings in 2020 refers to type = 'Meeting' where YEAR(event_date) = 2020; average = DIVIDE(COUNT(event_id), COUNT(DISTINCT event_name))
SQL:
SELECT CAST(COUNT(T2.link_to_event) AS REAL) / COUNT(DISTINCT T2.link_to_event) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE SUBSTR(T1.event_date, 1, 4) = '2020' AND T1.type = 'Meeting'
Database: student_club
Question: What is the most expensive item that was spent in support of club events?
Evidence: item in support of club events refers to expense_description; most expensive refers to MAX(cost)
SQL:
SELECT expense_description FROM expense ORDER BY cost DESC LIMIT 1
Database: student_club
Question: How many members of the Student_Club have majored Environmental Engineering?

Evidence: 'Environmental Engineering' is the major name
SQL:
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.major_name = 'Environmental Engineering'
Database: student_club
Question: List the full name of all the members of the Student_Club who attended the "Laugh Out Loud" event.
Evidence: full name of members refers to first_name, last_name; 'Laugh Out Loud' is an event name;
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member INNER JOIN event AS T3 ON T2.link_to_event = T3.event_id WHERE T3.event_name = 'Laugh Out Loud'
Database: student_club
Question: List the last name of all the students who majored Law and Constitutional Studies. 

Evidence: 'Law and Constitutional Studies' is the major name
SQL:
SELECT T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.major_name = 'Law and Constitutional Studies'
Database: student_club
Question: What county did Sherri Ramsey grew up?
SQL:
SELECT T2.county FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Sherri' AND T1.last_name = 'Ramsey'
Database: student_club
Question: What college offers the major that Tyler Hewitt took?
SQL:
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Tyler' AND T1.last_name = 'Hewitt'
Database: student_club
Question: What is the amount of the funds that the Vice President received?
Evidence: 'Vice President' is a position of Student Club; funds received refers to amount.
SQL:
SELECT T2.amount
FROM member AS T1
INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member
WHERE T1.position = 'Vice President';
Database: student_club
Question: How much did the Student_Club members spend on food in the September Meeting?
Evidence: amount spent refers to spent; spend on food in September Meeting refers to category = 'Food' where event_name = 'September Meeting'
SQL:
SELECT T2.spent FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'September Meeting' AND T2.category = 'Food'
Database: student_club
Question: What is the hometown city and state of the Student Club President?
Evidence: 'President' is a position of Student Club;
SQL:
SELECT T2.city, T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.position = 'President'
Database: student_club
Question: List the full name of the Student_Club members that grew up in Illinois state.
Evidence: full name of member refers to first_name, last_name
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.state = 'Illinois'
Database: student_club
Question: How much did the Student_Club members spend on advertisement in September Meeting?
Evidence: amount spent refers to spent; spend on food in September Meeting refers to category = 'Advertisement' where event_name = 'September Meeting'
SQL:
SELECT T2.spent FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'September Meeting' AND T2.category = 'Advertisement'
Database: student_club
Question: What department offers the major that Pierce and Guidi took?
SQL:
SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.last_name = 'Pierce' OR T1.last_name = 'Guidi'
Database: student_club
Question: What is the total budgeted amount for all category in "October Speaker" event?
Evidence: total budgeted amount refers to SUM(amount) where event_name = 'October Speaker'
SQL:
SELECT SUM(T2.amount) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'October Speaker'
Database: student_club
Question: Was each expense in October Meeting on October 8, 2019 approved?
Evidence: event_name = 'October Meeting' where event_date = '2019-10-08'; approved = True means expenses was approved; approved = False means expenses was not approved
SQL:
SELECT T3.approved 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' AND T1.event_date LIKE '2019-10-08%'
Database: student_club
Question: Calculate the total average cost that Elijah Allen spent in the events on September and October.
Evidence: Elijah Allen is the full name; full name refers to first_name, last_name; The 5th and 6th string of the expense_date in the expense table can refer to month; events in September and October refers to month(expense_date) = 9 OR month(expense_date) = 10
SQL:
SELECT AVG(T2.cost) FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.last_name = 'Allen' AND T1.first_name = 'Elijah' AND (SUBSTR(T2.expense_date, 6, 2) = '09' OR SUBSTR(T2.expense_date, 6, 2) = '10')
Database: student_club
Question: Calculate the difference of the total amount spent in all events by the Student_Club in year 2019 and 2020.
Evidence: The first 4 strings of the event_date values in the event table can represent year; The difference of the total amount spent = SUBTRACT(spent where YEAR(event_date) = 2019, spent where YEAR(event_date) = 2020)
SQL:
SELECT SUM(CASE WHEN SUBSTR(T1.event_date, 1, 4) = '2019' THEN T2.spent ELSE 0 END) - SUM(CASE WHEN SUBSTR(T1.event_date, 1, 4) = '2020' THEN T2.spent ELSE 0 END) AS num FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event
Database: student_club
Question: Give the location for "Spring Budget Review".
Evidence: 'Spring Budget Review' is an event name;
SQL:
SELECT location FROM event WHERE event_name = 'Spring Budget Review'
Database: student_club
Question: What was the cost for the "Posters" on 2019/9/4?
Evidence: 'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04'
SQL:
SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'
Database: student_club
Question: With the biggest budget for the "Food", what was the remaining of it?
Evidence: remaining of budget refers to remaining, biggest budget for 'Food' refers to MAX(budget.amount) where category = 'Food'
SQL:
SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget WHERE category = 'Food' )
Database: student_club
Question: What was the notes of the fundraising on 2019/9/14?
Evidence: 2019/9/14 refers to September 14, 2019
SQL:
SELECT notes FROM income WHERE source = 'Fundraising' AND date_received = '2019-09-14'
Database: student_club
Question: How many majors are there in "College of Humanities and Social Sciences"?
SQL:
SELECT COUNT(major_name) FROM major WHERE college = 'College of Humanities and Social Sciences'
Database: student_club
Question: Tell the phone number of "Carlo Jacobs".
Evidence: Carlo Jacobs is the full name; full name refers to first_name, last_name;
SQL:
SELECT phone FROM member WHERE first_name = 'Carlo' AND last_name = 'Jacobs'
Database: student_club
Question: Tell the hometown county for "Adela O'Gallagher".
Evidence: hometown county refers to county
SQL:
SELECT T2.county FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Adela' AND T1.last_name = 'O''Gallagher'
Database: student_club
Question: For all the budgets for "November Meeting", how many of them had exceeded the budget?
Evidence: 'November Meeting' is an event name; remaining < 0 means the cost had exceeded the budget
SQL:
SELECT COUNT(T2.event_id) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'November Meeting' AND T1.remaining < 0
Database: student_club
Question: Provide the total number of the budget amount for "September Speaker" event.
Evidence: 'September Speaker' is an event name; total number of budget amount refers to SUM(amount)
SQL:
SELECT SUM(T1.amount) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'September Speaker'
Database: student_club
Question: What is the status of the event which bought "Post Cards, Posters" on 2019/8/20?
Evidence: 'Post Cards, Posters' is an expense description; on 2019/8/20 refers to expense_date = '2019-8-20'; status of event refers to event_status
SQL:
SELECT T1.event_status FROM budget AS T1 INNER JOIN expense AS T2 ON T1.budget_id = T2.link_to_budget WHERE T2.expense_description = 'Post Cards, Posters' AND T2.expense_date = '2019-08-20'
Database: student_club
Question: What was Brent Thomason's major?
Evidence: Brent Thomason is the full name; full name refers to first_name, last_name; major refers to major_name
SQL:
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Brent' AND T1.last_name = 'Thomason'
Database: student_club
Question: For all the club members from "Business" major, how many of them wear medium size t-shirt?
Evidence: 'Business' is a major name; wear medium size t-shirt refers to t_shirt_size = 'Medium'
SQL:
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.major_name = 'Business' AND T1.t_shirt_size = 'Medium'
Database: student_club
Question: What's Christof Nielson's zip code type?
SQL:
SELECT T2.type FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Christof' AND T1.last_name = 'Nielson'
Database: student_club
Question: State the major name for the Vice President of the club.
Evidence: 'Vice President' is a position of Student Club
SQL:
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position = 'Vice President'
Database: student_club
Question: Where is the hometown state for "Sacha Harrison"?
Evidence: hometown state refers to state;
SQL:
SELECT T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Sacha' AND T1.last_name = 'Harrison'
Database: student_club
Question: Which department was the President of the club in?
Evidence: 'President' is a position of Student Club
SQL:
SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position = 'President'
Database: student_club
Question: State the date Connor Hilton paid his/her dues.
Evidence: Connor Hilton is the full name; full name refers to first_name, last_name; date the dues was paid refers to date_received where source = 'Dues';
SQL:
SELECT T2.date_received FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Connor' AND T1.last_name = 'Hilton' AND T2.source = 'Dues'
Database: student_club
Question: Who was the first one paid his/her dues? Tell the full name.
Evidence: Full name refers to first and last name; “first paid dues” means the earliest dues payment date.
SQL:
SELECT T1.first_name, T1.last_name
FROM member AS T1
INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member
WHERE T2.source = 'Dues'
ORDER BY T2.date_received ASC, T1.member_id ASC
LIMIT 1;
Database: student_club
Question: How many times was the budget in Advertisement for "Yearly Kickoff" meeting more than "October Meeting"?
Evidence: budget in Advertisement refer to category = 'Advertisement' in the budget table; DIVIDE(SUM(amount when event_name = 'Yearly Kickoff'), SUM(amount when event_name = 'October Meeting'))
SQL:
SELECT CAST(SUM(CASE WHEN T2.event_name = 'Yearly Kickoff' THEN T1.amount ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.event_name = 'October Meeting' THEN T1.amount ELSE 0 END) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T1.category = 'Advertisement' AND T2.type = 'Meeting'
Database: student_club
Question: What percentage was the budget for Parking to the total budget for the "November Speaker"?
Evidence: DIVDE(SUM( amount where category = 'Parking' and event_name = 'November Speaker'), COUNT(event_name = 'November Speaker)) * 100
SQL:
SELECT CAST(SUM(CASE WHEN T1.category = 'Parking' THEN T1.amount ELSE 0 END) AS REAL) * 100 / SUM(T1.amount) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'November Speaker'
Database: student_club
Question: What is the total cost of the pizzas for all the events?
Evidence: total cost of the pizzas refers to SUM(cost) where expense_description = 'Pizza'
SQL:
SELECT SUM(cost) FROM expense WHERE expense_description = 'Pizza'
Database: student_club
Question: How many cities are there in Orange County, Virginia?
Evidence: Orange County is the county name, Virginia is the state name
SQL:
SELECT COUNT(city) FROM zip_code WHERE county = 'Orange County' AND state = 'Virginia'
Database: student_club
Question: List all of the College of Humanities and Social Sciences' departments.
SQL:
SELECT DISTINCT department FROM major WHERE college = 'College of Humanities and Social Sciences'
Database: student_club
Question: Where is Amy Firth's hometown?
Evidence: hometown refers to city, county, state
SQL:
SELECT T2.city, T2.county, T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Amy' AND T1.last_name = 'Firth'
Database: student_club
Question: What are the expenses of the budget with the lowest remaining?
Evidence: expense of budget refers to expense_description; lowest remaining refers to MIN(remaining)
SQL:
SELECT T2.expense_description FROM budget AS T1 INNER JOIN expense AS T2 ON T1.budget_id = T2.link_to_budget ORDER BY T1.remaining LIMIT 1
Database: student_club
Question: List all the members who attended the event "October Meeting".
Evidence: 'October Meeting' is an event name;
SQL:
SELECT DISTINCT T3.member_id FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T1.event_name = 'October Meeting'
Database: student_club
Question: Which college do most of the members go to?
Evidence: college most members go refers to MAX(COUNT(major.college))
SQL:
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id GROUP BY T2.college ORDER BY COUNT(T2.college) DESC LIMIT 1
Database: student_club
Question: What does the person with the phone number "809-555-3360" major in?
Evidence: [Remove Evidence]
SQL:
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.phone = '809-555-3360'
Database: student_club
Question: Which event has the highest budget amount?
Evidence: event refers to event_name; highest budget amount refers to MAX(amount)
SQL:
SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id ORDER BY T1.amount DESC LIMIT 1
Database: student_club
Question: List all the expenses incurred by the vice president.
Evidence: expense refers to expense_description; 'Vice President' is a position of the Student Club
SQL:
SELECT T2.expense_id, T2.expense_description
FROM member AS T1
INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member
WHERE T1.position = 'Vice President';
Database: student_club
Question: How many members attended the "Women's Soccer" event?
Evidence: 'Women's Soccer' is the event name;
SQL:
SELECT COUNT(T2.link_to_member) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'Women''s Soccer'
Database: student_club
Question: When did the member, Casey Mason, received the income?
Evidence: when the income was received refers to date_received
SQL:
SELECT T2.date_received FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Casey' AND T1.last_name = 'Mason'
Database: student_club
Question: How many of the members' hometowns are from Maryland state?
SQL:
SELECT COUNT(T2.member_id)
FROM zip_code AS T1
INNER JOIN member AS T2 ON T1.zip_code = T2.zip
WHERE T1.state = 'Maryland';
Database: student_club
Question: How many events did the member with the phone number "954-555-6240" attend?
SQL:
SELECT COUNT(T2.link_to_event) FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member WHERE T1.phone = '954-555-6240'
Database: student_club
Question: List all the members of the "School of Applied Sciences, Technology and Education" department.
Evidence: list all members means to list all the full name; full name refers to first_name, last_name;
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.department = 'School of Applied Sciences, Technology and Education'
Database: student_club
Question: Among all the closed events, which event has the highest spend-to-budget ratio?
Evidence: closed events refers to event_name where status = 'Closed'; highest spend-to budget ratio refers to MAX(DIVIDE(spent, amount))
SQL:
SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.status = 'Closed' ORDER BY T1.spent / T1.amount DESC LIMIT 1
Database: student_club
Question: How many student have the position of president?
Evidence: 'President' is a position of Student Club
SQL:
SELECT COUNT(member_id) FROM member WHERE position = 'President'
Database: student_club
Question: What is the highest amount of budget spend for an event?
Evidence: highest amount of budget spend refers to MAX(spent)
SQL:
SELECT MAX(spent) FROM budget
Database: student_club
Question: How many meeting events were held in 2020?
Evidence: meeting events refers to type = 'Meeting'; held in 2020 refers to YEAR(event_date) = 2020
SQL:
SELECT COUNT(event_id) FROM event WHERE type = 'Meeting' AND SUBSTR(event_date, 1, 4) = '2020'
Database: student_club
Question: What is the total amount of money spent for food?
Evidence: total amount of money spent refers to SUM(spent); spent for food refers to category = 'Food'
SQL:
SELECT SUM(spent) FROM budget WHERE category = 'Food'
Database: student_club
Question: List the name of students that have attended more than 7 events.
Evidence: name of students means the full name; full name refers to first_name, last_name; attended more than 7 events refers to COUNT(link_to_event) > 7
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN attendance AS T2 ON T1.member_id = T2.link_to_member GROUP BY T2.link_to_member HAVING COUNT(T2.link_to_event) > 7
Database: student_club
Question: Among the students majored in interior design, who have attended the Community Theater event?
Evidence: majored in interior design refers to major_name = 'Interior Design'; 'Community Theater' is the event name;
SQL:
SELECT T2.first_name, T2.last_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member INNER JOIN event AS T4 ON T3.link_to_event = T4.event_id WHERE T4.event_name = 'Community Theater' AND T1.major_name = 'Interior Design'
Database: student_club
Question: State the name of students from Georgetown, South Carolina.
Evidence: name of students means the full name; Georgetown is a city; South Carolina is a state
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.city = 'Georgetown' AND T2.state = 'South Carolina'
Database: student_club
Question: How many income generated by Grant Gilmour?
Evidence: income generated refers to income.amount
SQL:
SELECT SUM(T2.amount) FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Grant' AND T1.last_name = 'Gilmour'
Database: student_club
Question: Which students were able to generate income more than $40?
Evidence: name of students means first_name, last_name; generate income more than $40 refers to income.amount > 40
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T2.amount > 40
Database: student_club
Question: What is the total expense for the Yearly Kickoff?
Evidence: 'Yearly Kickoff' is an event name; total expense refers to SUM(cost)
SQL:
SELECT 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 = 'Yearly Kickoff'
Database: student_club
Question: Which student has been entrusted to manage the budget for the Yearly Kickoff?
Evidence: name of students means the full name; full name refers to first_name, last_name;'Yearly Kickoff' is an event name;
SQL:
SELECT T4.first_name, T4.last_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 INNER JOIN member AS T4 ON T3.link_to_member = T4.member_id WHERE T1.event_name = 'Yearly Kickoff'
Database: student_club
Question: Which students manage to generate the highest income. State his/her full name along with the income source.
Evidence: full name refers to first_name, last_name; generate the highest income refers to the total income amount
SQL:
SELECT T1.first_name, T1.last_name, T2.source FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member GROUP BY T1.first_name, T1.last_name, T2.source ORDER BY SUM(T2.amount) DESC LIMIT 1
Database: student_club
Question: Which event has the lowest cost?
Evidence: event refers to event_name; lowest cost means MIN(cost)
SQL:
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 ORDER BY T3.cost LIMIT 1
Database: student_club
Question: Based on the total cost for all event, what is the percentage of cost for Yearly Kickoff event?
Evidence: percentage is the ratio of the cost for the 'Yearly Kickoff' event to the total cost of all events, multiplied by 100.
SQL:
SELECT CAST(SUM(CASE WHEN T1.event_name = 'Yearly Kickoff' THEN T3.cost ELSE 0 END) AS REAL) * 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
Database: student_club
Question: What is the ratio of students majoring in finance to those majoring in physics?
Evidence: Students are members. They are represented by the member table. 
Ratio = (Count of students (members) majoring in Finance) divided by (Count of students (members) majoring in Physics).
SQL:
SELECT CAST(SUM(CASE WHEN m2.major_name = 'Finance' THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN m2.major_name = 'Physics' THEN 1 ELSE 0 END) AS FLOAT), 0) AS ratio FROM member m1 JOIN major m2 ON m1.link_to_major = m2.major_id
Database: student_club
Question: Indicate the top source of funds received in September 2019 based on their amount.
Evidence: top source funds refers to MAX(source); September 2019 means date_received BETWEEN '2019-09-01' and '2019-09-30'
SQL:
SELECT source FROM income WHERE date_received BETWEEN '2019-09-01' and '2019-09-30' ORDER BY source DESC LIMIT 1
Database: student_club
Question: Provide the full name and email address of the Student_Club's Secretary.
Evidence: full name refers to first_name, last_name; 'Secretary' is a position of Student Club
SQL:
SELECT first_name, last_name, email FROM member WHERE position = 'Secretary'
Database: student_club
Question: How many members of the Student_Club have major in 'Physics Teaching'?
Evidence: 'Physics Teaching' is the major_name;
SQL:
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 = 'Physics Teaching'
Database: student_club
Question: How many members did attend the event 'Community Theater' in 2019?
Evidence: event 'Community Theater' in 2019 refers to event_name = 'Community Theater' where YEAR(event_date) = 2019
SQL:
SELECT COUNT(T2.link_to_member) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'Community Theater' AND SUBSTR(T1.event_date, 1, 4) = '2019'
Database: student_club
Question: Provide the number of events attended by Luisa Guidi. What is her major?
SQL:
SELECT COUNT(T3.link_to_event), T1.major_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member WHERE T2.first_name = 'Luisa' AND T2.last_name = 'Guidi'
Database: student_club
Question: On average, how much did the Student_Club spend on food for the typical event in the past?
Evidence: DIVIDE(SUM(spent), COUNT(spent)) where category = 'Food'; 'event in the past' means event_status = 'Closed'
SQL:
SELECT SUM(spent) / COUNT(spent) FROM budget WHERE category = 'Food' AND event_status = 'Closed'
Database: student_club
Question: Name the event with the highest amount spent on advertisement.
Evidence: advertisement refers to category = 'Advertisement'; highest amount spent refers to the maximum value in the spent column for advertisement category
SQL:
SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T1.category = 'Advertisement' ORDER BY T1.spent DESC, T2.event_id ASC LIMIT 1
Database: student_club
Question: Did Maya Mclean attend the 'Women's Soccer' event?
Evidence: Maya Mclean is the full name; full name refers to first_name, last_name; 'Women's Soccer' is an event_name
SQL:
SELECT 
    CASE 
        WHEN EXISTS (
            SELECT 1 
            FROM member T1
            INNER JOIN attendance T2 ON T1.member_id = T2.link_to_member
            INNER JOIN event T3 ON T2.link_to_event = T3.event_id
            WHERE T1.first_name = 'Maya' 
              AND T1.last_name = 'Mclean' 
              AND T3.event_name = 'Women''s Soccer'
        ) THEN 'YES'
        ELSE 'NO' 
    END AS attendance_result
LIMIT 1;
Database: student_club
Question: Among all events hold by the Student_Club in 2019, find the percentage share of events related to 'Community Service'
Evidence: DIVIDE(SUM(type = 'Community Service'), COUNT(event_id)) * 100 where event_date BETWEEN' 2019-01-01' and '2019-12-31'
SQL:
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'
Database: student_club
Question: Indicate the cost of posters for 'September Speaker' event.
Evidence: 'Posters' is the expense description; 'September Speaker' is an event name
SQL:
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'
Database: student_club
Question: What is the most popular size of t-shirt ordered by the club members?
Evidence: most popular size of t-shirt ordered refers to MAX(COUNT(t_shirt_size))
SQL:
SELECT t_shirt_size FROM member GROUP BY t_shirt_size ORDER BY COUNT(t_shirt_size) DESC LIMIT 1
Database: student_club
Question: Indicate the name of the closed event whose cost has exceeded the budget the most.
Evidence: closed events refers to event_name where status = 'Closed'; exceed the budget the most refers to MIN(remaining) where remaining < 0
SQL:
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
Database: student_club
Question: Identify the type of expenses and their total value approved for 'October Meeting' event.
Evidence: total value refers to SUM(cost); 'October Meeting' is an event name;
SQL:
SELECT T3.expense_description, 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' AND T3.approved = 'true'
GROUP BY T3.expense_description
Database: student_club
Question: Calculate the amount budgeted for 'April Speaker' event. List all the budgeted categories for said event in an ascending order based on their amount budgeted.
Evidence: 'April Speaker' is an event name; amount budgeted refers to SUM(amount); budget categories refers to category
SQL:
SELECT T2.category, SUM(T2.amount) FROM event AS T1 JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'April Speaker' GROUP BY T2.category ORDER BY SUM(T2.amount) ASC
Database: student_club
Question: Among the budgets for Food, which one has the highest budgeted amount?
Evidence: MAX(amount) where category = 'Food'
SQL:
SELECT budget_id 
FROM budget 
WHERE category = 'Food' 
  AND amount = (SELECT MAX(amount) FROM budget WHERE category = 'Food')
Database: student_club
Question: Among the budgets for Advertising, list out top three which have the most budgeted amount?
Evidence: Advertising is the category of budget; budgeted amount refers to amount
SQL:
SELECT budget_id FROM budget WHERE category = 'Advertisement' ORDER BY amount DESC, budget_id ASC LIMIT 3
Database: student_club
Question: Calculate the total cost spent for Parking in the list.
Evidence: total cost spent for Parking refers to SUM(cost) where expense_description = 'Parking'
SQL:
SELECT SUM(cost) FROM expense WHERE expense_description = 'Parking'
Database: student_club
Question: Mention the total expense used on 8/20/2019.
Evidence: total expense refers to adding up costs where expense_date = '2019-08-20'
SQL:
SELECT SUM(cost) FROM expense WHERE expense_date = '2019-08-20'
Database: student_club
Question: List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred?
Evidence: full name refers to first_name, last name
SQL:
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'
Database: student_club
Question: State what kind of expenses that Sacha Harrison incurred?
Evidence: kind of expenses refers to expense_description; Sacha Harrison is the full name; full name refers to first_name, last_name;
SQL:
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'
Database: student_club
Question: What kind of expenses incurred by members who have X-Large in size of tee shirt?
Evidence: kind of expenses refers to expense_description; t_shirt_size = 'X-Large'
SQL:
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'
Database: student_club
Question: Mention the zip code of members who incurred less than 50USD.
Evidence: incurred less than 50USD refers to cost < 50
SQL:
SELECT T1.zip FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T2.cost < 50
Database: student_club
Question: State the name of major that Phillip Cullen has joined.
Evidence: name of major refers to major_name
SQL:
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'
Database: student_club
Question: List out the position of members who joined major of Business.
Evidence: 'Business' is the major name
SQL:
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'
Database: student_club
Question: How many members of Business have the Medium size of tee shirt?
Evidence: members of Business refers to major_name = 'Business'; t_shirt_size = 'Medium'
SQL:
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'
Database: student_club
Question: List out the type of events which have remaining budget more than 30 USD.
Evidence: remaining budget more than 30 USD refers to remaining > 30
SQL:
SELECT T1.type FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.remaining > 30
Database: student_club
Question: Mention the category of events which were held at MU 215.
SQL:
SELECT type FROM event WHERE location = 'MU 215'
Database: student_club
Question: What are the budget categories for the event that took place on 2020-03-24T12:00:00?
Evidence: taken place in 2020-03-24T12:00:00 refers to event_date = '2020-03-24T12:00:00'
SQL:
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'
Database: student_club
Question: State the name of major that Vice President has joined.
Evidence: name of major refers to major_name; 'Vice President' is position of Student Club
SQL:
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'
Database: student_club
Question: Calculate the percentage of members who are major Business in the list?
Evidence: DIVIDE(SUM(position = 'Member' and major_name = 'Business'), COUNT(member_id)) * 100
SQL:
SELECT CAST(SUM(CASE WHEN T2.major_name = 'Business' 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'
Database: student_club
Question: State the category of events were held at MU 215.
Evidence: 'MU 215' is the location of event; 
SQL:
SELECT DISTINCT T2.category FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.location = 'MU 215'
Database: student_club
Question: How many income are received with an amount of 50?
Evidence: amount of 50 refers to amount = 50
SQL:
SELECT COUNT(income_id)
FROM income
WHERE amount = 50;
Database: student_club
Question: Among the members, how many of them have an extra large t-shirt size?
Evidence: among the members refers to position = 'Member'; extra large t-shirt size refers to t_shirt_size = 'X-Large'
SQL:
SELECT COUNT(member_id) FROM member WHERE position = 'Member' AND t_shirt_size = 'X-Large'
Database: student_club
Question: In the College of Agriculture and Applied Sciences, how many majors are under the department of School of Applied Sciences, Technology and Education?
SQL:
SELECT COUNT(major_id) FROM major WHERE department = 'School of Applied Sciences, Technology and Education' AND college = 'College of Agriculture and Applied Sciences'
Database: student_club
Question: List the last name of members with a major in environmental engineering and include its department and college name.
Evidence: 'Environmental Engineering' is the major_name;
SQL:
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'
Database: student_club
Question: What are the budget category of the events located at MU 215 and a guest speaker type with a 0 budget spent?
Evidence: budget category refers to category; events located at refers to location; type = 'Guest Speaker'; 0 budget spent refers to spent = 0; 
SQL:
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'
Database: student_club
Question: List the city and state of members enrolled under electrical and computer engineering department.
Evidence: 'Electrical and Computer Engineering Department' is the department; members enrolled refers to position = 'Member'
SQL:
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'
Database: student_club
Question: 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.?
Evidence: name of social event refers to event_name where type = 'Social'; 'Vice President' is position; located at refers to location
SQL:
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'
Database: student_club
Question: What is the last name and position of the student that bought pizza on 09/10/2019?
Evidence: bought pizza on 09/10/2019 refers to expense_description = 'Pizza' where expense_date = '2019-09-10'
SQL:
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'
Database: student_club
Question: List the last name of the members of the club that attended the women's soccer event.
Evidence: members of the club refers to position = 'Member'; 'Women's Soccer' is event name;
SQL:
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'
Database: student_club
Question: Among the members with t-shirt size of medium, what is the percentage of the amount 50 received by the Student_Club?
Evidence: t_shirt_size = 'Medium' where position = 'Member'; percentage = DIVIDE(COUNT(amount = 50), COUNT(member_id)) * 100
SQL:
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'
Database: student_club
Question: Which counties have zip codes with post office boxes?
Evidence: zip codes that have post office boxes refers to type = 'PO Box'
SQL:
SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL
Database: student_club
Question: 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?
Evidence: zip codes that have post office boxes refers to type = 'PO Box'
SQL:
SELECT zip_code FROM zip_code WHERE type = 'PO Box' AND county = 'San Juan Municipio' AND state = 'Puerto Rico'
Database: student_club
Question: List the names of closed event as "game" that was closed from 3/15/2019 to 3/20/2020.
Evidence: 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'; 
SQL:
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'
Database: student_club
Question: Please provide links to events for members who have paid more than 50 dollar.
Evidence: have paid more than 50 dollar refers to cost > 50
SQL:
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
Database: student_club
Question: 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.
Evidence: approved from 1/10/2019 to 11/19/2019 refers to approved = 'true' and expense_date BETWEEN '2019-01-10' and '2019-11-19'
SQL:
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'
Database: student_club
Question: Please indicate the college of the person whose first name is Katy with the link to the major "rec1N0upiVLy5esTO".
SQL:
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'
Database: student_club
Question: Please list the phone numbers of the members who majored in business at the College of Agriculture and Applied Sciences.
Evidence: Business is a major offered at the College of Agriculture and Applied Sciences.
SQL:
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'
Database: student_club
Question: List emails of people who paid more than 20 dollars from 9/10/2019 to 11/19/2019.
Evidence: expense_date BETWEEN '2019-09-10' and '2019-11-19'; cost > 20
SQL:
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;
Database: student_club
Question: How many members have education major in the College of Education & Human Services?
Evidence: 'education' is the major name; 'Member' is a position of club;
SQL:
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'
Database: student_club
Question: What is the percentage of the events that went over budget?
Evidence: went over budget refers to a budget record where remaining < 0; a "over-budget event" is an event with at least one over-budget budget record; percentage = (Number of over-budget events ÷ Total number of events) × 100, where "Number of over-budget events" = COUNT(DISTINCT event_id with remaining < 0), "Total number of events" = COUNT(DISTINCT event.event_id)
SQL:
SELECT 
    CAST(COUNT(DISTINCT CASE WHEN b.remaining < 0 THEN b.link_to_event END) AS REAL) 
    / COUNT(DISTINCT e.event_id) 
    * 100 AS over_budget_event_percentage
FROM event e
LEFT JOIN budget b ON e.event_id = b.link_to_event;
Database: student_club
Question: Give the event ID, location, and status of events conducted from November 2019 to March 2020.
Evidence: event_date BETWEEN '2019-11-01' and '2020-03-31'
SQL:
SELECT event_id, location, status FROM event WHERE date(SUBSTR(event_date, 1, 10)) BETWEEN '2019-11-01' AND '2020-03-31'
Database: student_club
Question: List the expenses that spend more than fifty dollars on average.
Evidence: expense refers to expense_description; spend more than fifty dollars on average refers to DIVIDE( SUM(cost), COUNT(expense_id) ) > 50
SQL:
SELECT expense_description FROM expense GROUP BY expense_description HAVING AVG(cost) > 50
Database: student_club
Question: Find the full name of members whose t-shirt size is extra large.
Evidence: full name refers to first_name, last_name; t_shirt_size = 'X-Large'
SQL:
SELECT first_name, last_name FROM member WHERE t_shirt_size = 'X-Large'
Database: student_club
Question: Calculate the percentage of zip codes that are PO boxes.
Evidence: DIVIDE(SUM(type = 'PO Box'), COUNT(zip_code)) * 100
SQL:
SELECT CAST(SUM(CASE WHEN type = 'PO Box' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(zip_code) FROM zip_code
Database: student_club
Question: List the name and location of events that underspend its budget.
Evidence: name of event refers to event_name; underspend its budget refers to remaining > 0
SQL:
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
Database: student_club
Question: Find the name and date of events with expenses for pizza that were more than fifty dollars but less than a hundred dollars.
Evidence: 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
SQL:
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
Database: student_club
Question: What is the name and major of members who had to spend more than a hundred dollars on an expense?
Evidence: 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
SQL:
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
Database: student_club
Question: In the events with budget more than forty, list the location at which the event is happening.
SQL:
SELECT DISTINCT T1.location FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.amount > 40
Database: student_club
Question: Among the members who incurred expenses in more than one event, who paid the most amount?
SQL:
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
Database: student_club
Question: What is the average amount paid by students in a position other than a member?
Evidence: position other than a member refers to position != 'Member'; average amount paid is the average cost of expenses for such members.
SQL:
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'
Database: student_club
Question: List the name of events with less than average parking cost.
Evidence: name of events refers to event_name; less than average parking cost refers to cost < DIVIDE(SUM(cost), COUNT(event_id)) where category = 'Parking'
SQL:
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)
Database: student_club
Question: What is the percentage of the cost for the meeting events?
Evidence: meeting events refers to type = 'Meeting'; percentage = DIVIDE( SUM(cost), COUNT(event_id)) * 100
SQL:
SELECT SUM(CASE WHEN T1.type = 'Meeting' 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
Database: student_club
Question: Which budget allowed the most money for water, chips, and cookies?
Evidence: 'Water, chips, cookies' is the value in expense description to filter; most money refers to the highest cost among matching expenses
SQL:
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