Chinastark/bird_dataset huggingface dataset:
Database: student_club
Note: 'Spring budget Review' is an event name;
Question: Give the location for "Spring Budget Review".
SQL: SELECT LOCATION FROM event WHERE event_name = 'Spring Budget Review'
Database: student_club
Note: 'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04';
Question: What was the cost for the "Posters" on 2019/9/4?
SQL: SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'
Database: student_club
Note: remaining of budget refers to remaining, biggest budget for 'Food' refers to MAX(budget.amount) where category = 'Food';
Question: With the biggest budget for the "Food", what was the remaining of it?
SQL: SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT max(amount) FROM budget WHERE category = 'Food' )
Database: student_club
Note: fundraising on 2019/9/14 refers to source = 'Fundraising' where date_received = '2019-09-14';
Question: What was the notes of the fundraising on 2019/9/14?
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
Note: Carlo Jacobs is the full name; full name refers to first_name, last_name;
Question: Tell the phone number of "Carlo Jacobs".
SQL: SELECT phone FROM member WHERE first_name = 'Carlo' AND last_name = 'Jacobs'
Database: student_club
Note: hometown county refers to county;
Question: Tell the hometown county for "Adela O'Gallagher".
SQL: SELECT zip_code.county FROM member INNER JOIN zip_code ON member.zip = zip_code.zip_code WHERE member.first_name = 'Adela' AND member.last_name = 'O''Gallagher'
Database: student_club
Note: 'November Meeting' is an event name; remaining < 0 means the cost had exceeded the budget;
Question: For all the budgets for "November Meeting", how many of them had exceeded the budget?
SQL: SELECT count(event.event_id) FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE event.event_name = 'November Meeting' AND budget.remaining < 0
Database: student_club
Note: 'September Speaker' is an event name; total number of budget amount refers to SUM(amount);
Question: Provide the total number of the budget amount for "September Speaker" event.
SQL: SELECT sum(budget.amount) FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE event.event_name = 'September Speaker'
Database: student_club
Note: '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;
Question: What is the status of the event which bought "Post Cards, Posters" on 2019/8/20?
SQL: SELECT budget.event_status FROM budget INNER JOIN expense ON budget.budget_id = expense.link_to_budget WHERE expense.expense_description = 'Post Cards, Posters' AND expense.expense_date = '2019-08-20'
Database: student_club
Note: Brent Thomason is the full name; full name refers to first_name, last_name; major refers to major_name;
Question: What was Brent Thomason's major?
SQL: SELECT major.major_name FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE member.first_name = 'Brent' AND member.last_name = 'Thomason'
Database: student_club
Note: 'Business' is a major name; wear medium size t-shirt refers to t_shirt_size = 'Medium';
Question: For all the club members from "Business" major, how many of them wear medium size t-shirt?
SQL: SELECT count(member.member_id) FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE major.major_name = 'Business' AND member.t_shirt_size = 'Medium'
Database: student_club
Question: What's Christof Nielson's zip code type?
SQL: SELECT zip_code.type FROM member INNER JOIN zip_code ON member.zip = zip_code.zip_code WHERE member.first_name = 'Christof' AND member.last_name = 'Nielson'
Database: student_club
Note: 'Vice President' is a position of Student Club;
Question: State the major name for the Vice President of the club.
SQL: SELECT major.major_name FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE member.position = 'Vice President'
Database: student_club
Note: hometown state refers to state;
Question: Where is the hometown state for "Sacha Harrison"?
SQL: SELECT zip_code.state FROM member INNER JOIN zip_code ON member.zip = zip_code.zip_code WHERE member.first_name = 'Sacha' AND member.last_name = 'Harrison'
Database: student_club
Note: 'President' is a position of Student Club;
Question: Which department was the President of the club in?
SQL: SELECT major.department FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE member.position = 'President'
Database: student_club
Note: 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';
Question: State the date Connor Hilton paid his/her dues.
SQL: SELECT income.date_received FROM member INNER JOIN income ON member.member_id = income.link_to_member WHERE member.first_name = 'Connor' AND member.last_name = 'Hilton' AND income.source = 'Dues'
Database: student_club
Note: full name refers to first_name, last_name; first paid dues refers to MIN(received_date) where source = 'Dues';
Question: Who was the first one paid his/her dues? Tell the full name.
SQL: SELECT member.first_name, member.last_name FROM member INNER JOIN income ON member.member_id = income.link_to_member WHERE income.source = 'Dues' ORDER BY income.date_received LIMIT 1
Database: student_club
Note: 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'));
Question: How many times was the budget in Advertisement for "Yearly Kickoff" meeting more than "October Meeting"?
SQL: SELECT cast(sum(CASE WHEN event.event_name = 'Yearly Kickoff' THEN budget.amount ELSE 0 END) AS REAL) / sum(CASE WHEN event.event_name = 'October Meeting' THEN budget.amount ELSE 0 END) FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE budget.category = 'Advertisement' AND event.type = 'Meeting'
Database: student_club
Note: DIVDE(SUM( amount where category = 'Parking' and event_name = 'November Speaker'), COUNT(event_name = 'November Speaker)) * 100;
Question: What percentage was the budget for Parking to the total budget for the "November Speaker"?
SQL: SELECT cast(sum(CASE WHEN budget.category = 'Parking' THEN budget.amount ELSE 0 END) AS REAL) * 100 / sum(budget.amount) FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE event.event_name = 'November Speaker'
Database: student_club
Note: total cost of the pizzas refers to SUM(cost) where expense_description = 'Pizza';
Question: What is the total cost of the pizzas for all the events?
SQL: SELECT sum(cost) FROM expense WHERE expense_description = 'Pizza'
Database: student_club
Note: Orange county is the county name, Virginia is the state name;
Question: How many cities are there in Orange County, Virginia?
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 department FROM major WHERE college = 'College of Humanities and Social Sciences'
Database: student_club
Note: hometown refers to city, county, state;
Question: Where is Amy Firth's hometown?
SQL: SELECT zip_code.city, zip_code.county, zip_code.state FROM member INNER JOIN zip_code ON member.zip = zip_code.zip_code WHERE member.first_name = 'Amy' AND member.last_name = 'Firth'
Database: student_club
Note: expense of budget refers to expense_description; lowest remaining refers to MIN(remaining);
Question: What are the expenses of the budget with the lowest remaining?
SQL: SELECT expense.expense_description FROM budget INNER JOIN expense ON budget.budget_id = expense.link_to_budget ORDER BY budget.remaining LIMIT 1
Database: student_club
Note: 'October Meeting' is an event name;
Question: List all the members who attended the event "October Meeting".
SQL: SELECT DISTINCT member.member_id FROM event INNER JOIN attendance ON event.event_id = attendance.link_to_event INNER JOIN member ON attendance.link_to_member = member.member_id WHERE event.event_name = 'October Meeting'
Database: student_club
Note: college most members go refers to MAX(COUNT(major.college));
Question: Which college do most of the members go to?
SQL: SELECT major.college FROM member INNER JOIN major ON member.link_to_major = major.major_id GROUP BY major.major_id ORDER BY count(major.college) DESC LIMIT 1
Database: student_club
Note: major in refers to major_name;
Question: What does the person with the phone number "809-555-3360" major in?
SQL: SELECT major.major_name FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE member.phone = '809-555-3360'
Database: student_club
Note: event refers to event_name; highest budget amount refers to MAX(amount);
Question: Which event has the highest budget amount?
SQL: SELECT event.event_name FROM budget INNER JOIN event ON budget.link_to_event = event.event_id ORDER BY budget.amount DESC LIMIT 1
Database: student_club
Note: expense refers to expense_description; 'Vice President' is a position of the Student Club;
Question: List all the expenses incurred by the vice president.
SQL: SELECT expense.expense_id, expense.expense_description FROM member INNER JOIN expense ON member.member_id = expense.link_to_member WHERE member.position = 'Vice President'
Database: student_club
Note: 'Women's Soccer' is the event name;
Question: How many members attended the "Women's Soccer" event?
SQL: SELECT count(attendance.link_to_member) FROM event INNER JOIN attendance ON event.event_id = attendance.link_to_event WHERE event.event_name = 'Women''s Soccer'
Database: student_club
Note: when the income was received refers to date_received;
Question: When did the member, Casey Mason, received the income?
SQL: SELECT income.date_received FROM member INNER JOIN income ON member.member_id = income.link_to_member WHERE member.first_name = 'Casey' AND member.last_name = 'Mason'
Database: student_club
Question: How many of the members' hometowns are from Maryland state?
SQL: SELECT count(member.member_id) FROM zip_code INNER JOIN member ON zip_code.zip_code = member.zip WHERE zip_code.state = 'Maryland'
Database: student_club
Question: How many events did the member with the phone number "954-555-6240" attend?
SQL: SELECT count(attendance.link_to_event) FROM member INNER JOIN attendance ON member.member_id = attendance.link_to_member WHERE member.phone = '954-555-6240'
Database: student_club
Note: list all members means to list all the full name; full name refers to first_name, last_name;
Question: List all the members of the "School of Applied Sciences, Technology and Education" department.
SQL: SELECT member.first_name, member.last_name FROM member INNER JOIN major ON member.link_to_major = major.major_id WHERE major.department = 'School of Applied Sciences, Technology and Education'
Database: student_club
Note: closed events refers to event_name where status = 'Closed'; highest spend-to budget ratio refers to MAX(DIVIDE(spent, amount));
Question: Among all the closed events, which event has the highest spend-to-budget ratio?
SQL: SELECT event.event_name FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE event.status = 'Closed' ORDER BY budget.spent / budget.amount DESC LIMIT 1
Database: student_club
Note: 'President' is a position of Student Club;
Question: How many student have the position of president?
SQL: SELECT count(member_id) FROM member WHERE POSITION = 'President'
Database: student_club
Note: highest amount of budget spend refers to MAX(spent);
Question: What is the highest amount of budget spend for an event?
SQL: SELECT max(spent) FROM budget
Database: student_club
Note: meeting events refers to type = 'Meeting'; held in 2020 refers to YEAR(event_date) = 2020;
Question: How many meeting events were held in 2020?
SQL: SELECT count(event_id) FROM event WHERE TYPE = 'Meeting' AND substr(event_date, 1, 4) = '2020'
Database: student_club
Note: total amount of money spent refers to SUM(spent); spent for food refers to category = 'Food';
Question: What is the total amount of money spent for food?
SQL: SELECT sum(spent) FROM budget WHERE category = 'Food'
Database: student_club
Note: 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;
Question: List the name of students that have attended more than 7 events.
SQL: SELECT member.first_name, member.last_name FROM member INNER JOIN attendance ON member.member_id = attendance.link_to_member GROUP BY attendance.link_to_member HAVING count(attendance.link_to_event) > 7
Database: student_club
Note: majored in music refers to major_name = 'Interior Design'; 'Community Theater' is the event name;
Question: Among the students majored in interior design, who have attended the Community Theater event?
SQL: SELECT member.first_name, member.last_name FROM major INNER JOIN member ON major.major_id = member.link_to_major INNER JOIN attendance ON member.member_id = attendance.link_to_member INNER JOIN event ON attendance.link_to_event = event.event_id WHERE event.event_name = 'Community Theater' AND major.major_name = 'Interior Design'
Database: student_club
Note: name of students means the full name; full name refers to first_name, last_name; Georgetown is a city; South Carolina is a state;
Question: State the name of students from Georgetown, South Carolina.
SQL: SELECT member.first_name, member.last_name FROM member INNER JOIN zip_code ON member.zip = zip_code.zip_code WHERE zip_code.city = 'Georgetown' AND zip_code.state = 'South Carolina'
Database: student_club
Note: income generated refers to income.amount;
Question: How many income generated by Grant Gilmour?
SQL: SELECT income.amount FROM member INNER JOIN income ON member.member_id = income.link_to_member WHERE member.first_name = 'Grant' AND member.last_name = 'Gilmour'
Database: student_club
Note: name of students means the full name; full name refers to first_name, last_name; generate income more than $50 refers to income.amount > 40;
Question: Which student was able to generate income more than $40?
SQL: SELECT member.first_name, member.last_name FROM member INNER JOIN income ON member.member_id = income.link_to_member WHERE income.amount > 40
Database: student_club
Note: 'Yearly Kickoff' is an event name; total expense refers to SUM(cost);
Question: What is the total expense for the Yearly Kickoff?
SQL: SELECT sum(expense.cost) FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget WHERE event.event_name = 'Yearly Kickoff'
Database: student_club
Note: name of students means the full name; full name refers to first_name, last_name;'Yearly Kickoff' is an event name;
Question: Which student has been entrusted to manage the budget for the Yearly Kickoff?
SQL: SELECT member.first_name, member.last_name FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget INNER JOIN member ON expense.link_to_member = member.member_id WHERE event.event_name = 'Yearly Kickoff'
Database: student_club
Note: name of students means the full name; full name refers to first_name, last_name; generate the highest income refers to MAX(income.amount);
Question: Which students manage to generate the highest income. State his/her full name along with the income source.
SQL: SELECT member.first_name, member.last_name, income.source FROM member INNER JOIN income ON member.member_id = income.link_to_member GROUP BY member.first_name, member.last_name, income.source ORDER BY sum(income.amount) DESC LIMIT 1
Database: student_club
Note: event refers to event_name; lowest cost means MIN(cost);
Question: Which event has the lowest cost?
SQL: SELECT event.event_name FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget ORDER BY expense.cost LIMIT 1
Database: student_club
Note: percentage = DIVIDE(SUM(cost where event_name = 'Yearly Kickoff'), SUM(cost)) * 100;
Question: Based on the total cost for all event, what is the percentage of cost for Yearly Kickoff event?
SQL: SELECT cast(sum(CASE WHEN event.event_name = 'Yearly Kickoff' THEN expense.cost ELSE 0 END) AS REAL) * 100 / sum(expense.cost) FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget
Database: student_club
Note: DIVDE(SUM(major_name = 'Finance'), SUM(major_name = 'Physics'));
Question: What is the ratio between students majored in finance and physics?
SQL: SELECT sum(CASE WHEN major_name = 'Finance' THEN 1 ELSE 0 END) / sum(CASE WHEN major_name = 'Physics' THEN 1 ELSE 0 END) AS ratio FROM major
Database: student_club
Note: top source funds refers to MAX(source); September 2019 means date_received BETWEEN '2019-09-01' and '2019-09-30';
Question: Indicate the top source of funds received in September 2019 based on their amount.
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
Note: full name refers to first_name, last_name; 'Secretary' is a position of Student Club;
Question: Provide the full name and email address of the Student_Club's Secretary.
SQL: SELECT first_name, last_name, email FROM member WHERE POSITION = 'Secretary'
Database: student_club
Note: 'Physics Teaching' is the major_name;
Question: How many members of the Student_Club have major in 'Physics Teaching'?
SQL: SELECT count(member.member_id) FROM major INNER JOIN member ON major.major_id = member.link_to_major WHERE major.major_name = 'Physics Teaching'
Database: student_club
Note: event 'Community Theater' in 2019 refers to event_name = 'Community Theater' where YEAR(event_date) = 2019;
Question: How many members did attend the event 'Community Theater' in 2019?
SQL: SELECT count(attendance.link_to_member) FROM event INNER JOIN attendance ON event.event_id = attendance.link_to_event WHERE event.event_name = 'Community Theater' AND substr(event.event_date, 1, 4) = '2019'
Database: student_club
Note: major refers to major_name;
Question: Provide the number of events attended by Luisa Guidi. What is her major?
SQL: SELECT count(attendance.link_to_event), major.major_name FROM major INNER JOIN member ON major.major_id = member.link_to_major INNER JOIN attendance ON member.member_id = attendance.link_to_member WHERE member.first_name = 'Luisa' AND member.last_name = 'Guidi'
Database: student_club
Note: DIVIDE(SUM(spent), COUNT(spent)) where category = 'Food'; 'event in the past' means event_status = 'Closed';
Question: On average, how much did the Student_Club spend on food for the typical event in the past?
SQL: SELECT sum(spent) / count(spent) FROM budget WHERE category = 'Food' AND event_status = 'Closed'
Database: student_club
Note: Name of event refers to event_name; highest amount spent on advertisement refers to MAX(spent) where category = 'Advertisement';
Question: Name the event with the highest amount spent on advertisement.
SQL: SELECT event.event_name FROM budget INNER JOIN event ON budget.link_to_event = event.event_id WHERE budget.category = 'Advertisement' ORDER BY budget.spent DESC LIMIT 1
Database: student_club
Note: Maya Mclean is the full name; full name refers to first_name, last_name; 'Women's Soccer' is an event_name;
Question: Did Maya Mclean attend the 'Women's Soccer' event?
SQL: SELECT CASE WHEN event.event_name = 'Women''s Soccer' THEN 'YES' END AS RESULT FROM member INNER JOIN attendance ON member.member_id = attendance.link_to_member INNER JOIN event ON attendance.link_to_event = event.event_id WHERE member.first_name = 'Maya' AND member.last_name = 'Mclean'
Database: student_club
Note: DIVIDE(SUM(type = 'Community Service'), COUNT(event_id)) * 100 where event_date BETWEEN' 2019-01-01' and '2019-12-31';
Question: Among all events hold by the Student_Club in 2019, find the percentage share of events related to 'Community Service'
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
Note: 'Posters' is the expense description; 'September Speaker' is an event name;
Question: Indicate the cost of posters for 'September Speaker' event.
SQL: SELECT expense.cost FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget WHERE event.event_name = 'September Speaker' AND expense.expense_description = 'Posters'
Database: student_club
Note: most popular size of t-shirt ordered refers to MAX(COUNT(t_shirt_size));
Question: What is the most popular size of t-shirt ordered by the club members?
SQL: SELECT t_shirt_size FROM member GROUP BY t_shirt_size ORDER BY count(t_shirt_size) DESC LIMIT 1
Database: student_club
Note: closed events refers to event_name where status = 'Closed'; exceed the budget the most refers to MIN(remaining) where remaining < 0;
Question: Indicate the name of the closed event whose cost has exceeded the budget the most.
SQL: SELECT event.event_name FROM budget INNER JOIN event ON event.event_id = budget.link_to_event WHERE budget.event_status = 'Closed' AND budget.remaining < 0 ORDER BY budget.remaining LIMIT 1
Database: student_club
Note: total value refers to SUM(cost); 'October Meeting' is an event name;
Question: Identify the type of expenses and their total value approved for 'October Meeting' event.
SQL: SELECT event.type, sum(expense.cost) FROM event INNER JOIN budget ON event.event_id = budget.link_to_event INNER JOIN expense ON budget.budget_id = expense.link_to_budget WHERE event.event_name = 'October Meeting'
Database: student_club
Note: 'April Speaker' is an event name; amount budgeted refers to SUM(amount); budget categories refers to category;
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.
SQL: SELECT budget.category, sum(budget.amount) FROM event JOIN budget ON event.event_id = budget.link_to_event WHERE event.event_name = 'April Speaker' GROUP BY budget.category ORDER BY sum(budget.amount) ASC
Database: student_club
Note: MAX(amount) where category = 'Food';
Question: Among the budgets for Food, which one has the highest budgeted amount?
SQL: SELECT budget_id FROM budget WHERE category = 'Food' AND amount = ( SELECT max(amount) FROM budget )
Database: student_club
Note: MAX(amount) where category = 'Advertisement';
Question: Among the budgets for Advertising, list out top three which have the most budgeted amount?
SQL: SELECT budget_id FROM budget WHERE category = 'Advertisement' ORDER BY amount DESC LIMIT 3
Database: student_club
Note: total cost spent for Parking refers to SUM(cost) where expense_description = 'Parking';
Question: Calculate the total cost spent for Parking in the list.
SQL: SELECT sum(cost) FROM expense WHERE expense_description = 'Parking'
Database: student_club
Note: total expense refers SUM(cost) where expense_date = '2019-08-20';
Question: Mention the total expense used on 8/20/2019.
SQL: SELECT sum(cost) FROM expense WHERE expense_date = '2019-08-20'
Database: student_club
Note: full name refers to first_name, last name;
Question: List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred?
SQL: SELECT member.first_name, member.last_name, sum(expense.cost) FROM member INNER JOIN expense ON member.member_id = expense.link_to_member WHERE member.member_id = 'rec4BLdZHS2Blfp4v'