question_id
int64
0
1.53k
db_id
stringclasses
11 values
question
stringlengths
23
477
evidence
stringlengths
0
482
SQL
stringlengths
29
3.69k
difficulty
stringclasses
3 values
1,300
thrombosis_prediction
What is the disease name of the patient who has the highest level of triglyceride within the normal range?
disease name refers to Diagnosis; highest level of triglyceride within the normal range refers to MAX(TG < 200);
SELECT T1.Diagnosis FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 ORDER BY T2.TG DESC LIMIT 1
moderate
1,301
thrombosis_prediction
Please list the IDs of the patients with no thrombosis and an abnormal level of creatinine phosphokinase.
no thrombosis refers to Thrombosis = 0 ; abnormal level of creatinine phosphokinase refers to CPK < 250;
SELECT DISTINCT T1.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 0 AND T1.CPK < 250
simple
1,302
thrombosis_prediction
For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation?
normal range of creatinine phosphokinase refers to CPK < 250; positive measure of degree of coagulation refers to KCT = '+' or RVVT = '+' or LAC = '+' ;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')
challenging
1,303
thrombosis_prediction
When is the birthday of the oldest patient whose blood glucose is abnormal?
oldest patient refers to MIN(Birthday); blood glucose is abnormal refers to GLU > 180;
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU > 180 ORDER BY T1.Birthday ASC LIMIT 1
simple
1,304
thrombosis_prediction
Among the patients with a normal blood glucose, how many of them don't have thrombosis?
normal blood glucose refers to GLU < 180; patients without thrombosis have Thrombosis value of 0;
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.GLU < 180 AND T3.Thrombosis = 0
moderate
1,305
thrombosis_prediction
How many patients accepted to the hospital have a normal level of white blood cells?
accepted to the hospital refers to Admission = '+'; normal level of white blood cells refers to WBC between 3.5 and 9.0;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC BETWEEN 3.5 AND 9 AND T1.Admission = '+'
moderate
1,306
thrombosis_prediction
How many patients diagnosed with SLE have a normal white blood cell level?
diagnosed with SLE refers to Diagnosis = 'SLE'; normal white blood cell level refers to WBC between 3.5 and 9.0;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SLE' AND T2.WBC BETWEEN 3.5 AND 9
simple
1,307
thrombosis_prediction
Please list the patient's ID if he or she has an abnormal level of red blood cell and is followed at the outpatient clinic.
RBC < = 3.5 or RBC > = 6.0 means the patient has an abnormal level of red blood cell; 3.5 < RBC < 6.0 means the patient has a normal level of red blood cell; followed at the outpatient clinic refers to Admission = '-';
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.RBC <= 3.5 OR T2.RBC >= 6) AND T1.Admission = '-'
challenging
1,308
thrombosis_prediction
Among the patients who have a normal platelet level, how many of them have other symptoms observed?
normal platelet level refers to PLT > 100 and PLT < 400; have other symptoms refers to Diagnosis is not null;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT > 100 AND T2.PLT < 400 AND T1.Diagnosis IS NOT NULL
moderate
1,309
thrombosis_prediction
Please list a patient's platelet level if it is within the normal range and if he or she is diagnosed with MCTD.
PLT > 100 and PLT < 400 means platelet level is within the normal range; PLT < 100 and PLT > 400 means platelet level is not within the normal range; diagnosed with MCTD refers to Diagnosis = 'MCTD';
SELECT T2.PLT FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'MCTD' AND T2.PLT BETWEEN 100 AND 400
moderate
1,310
thrombosis_prediction
For the male patients that have a normal prothrombin time, what is their average prothrombin time?
male refers to Sex = 'M'; normal prothrombin time refer to PT < 14; average prothrombin time = AVG(PT);
SELECT AVG(T2.PT) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PT < 14 AND T1.SEX = 'M'
simple
1,311
thrombosis_prediction
How many patients with severe thrombosis have a normal prothrombin time?
severe thrombosis refers to Thrombosis = 2 or 1; normal prothrombin time refers to PT < 14;
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.PT < 14 AND T3.Thrombosis < 3 AND T3.Thrombosis > 0
moderate
1,312
student_club
What's Angela Sanders's major?
major refers to major_name
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 = 'Angela' AND T1.last_name = 'Sanders'
simple
1,313
student_club
How many students in the Student_Club are from the College of Engineering?
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.college = 'College of Engineering'
simple
1,314
student_club
Please list the full names of the students in the Student_Club that come from the Art and Design Department.
full name refers to first_name, last_name;
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 = 'Art and Design Department'
simple
1,315
student_club
How many students of the Student_Club have attended the event "Women's Soccer"?
Women's Soccer is an event name
SELECT COUNT(T1.event_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'Women''s Soccer'
simple
1,316
student_club
Please list the phone numbers of the students from the Student_Club that has attended the event "Women's Soccer".
Women's Soccer is an event name; phone numbers refers to phone
SELECT T3.phone 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 = 'Women''s Soccer'
moderate
1,317
student_club
Among the students from the Student_Club who attended the event "Women's Soccer", how many of them want a T-shirt that's in medium size?
Students refer to members; Women's Soccer is an event name; T-shirt that is in medium size refers to t_shirt_size = 'Medium'
SELECT COUNT(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 = 'Women''s Soccer' AND T3.t_shirt_size = 'Medium'
moderate
1,318
student_club
What is the event that has the highest attendance of the students from the Student_Club?
highest attendance refers to the event with the most attendees
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event GROUP BY T1.event_name ORDER BY COUNT(T2.link_to_event) DESC LIMIT 1
simple
1,319
student_club
Which college is the vice president of the Student_Club from?
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position LIKE 'vice president'
simple
1,320
student_club
Please list the event names of all the events attended by Maya Mclean.
SELECT T1.event_name 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 T3.first_name = 'Maya' AND T3.last_name = 'Mclean'
simple
1,321
student_club
How many events of the Student_Club did Sacha Harrison attend in 2019?
events attended in 2019 refers to YEAR(event_date) = 2019
SELECT COUNT(T1.event_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 T3.first_name = 'Sacha' AND T3.last_name = 'Harrison' AND SUBSTR(T1.event_date, 1, 4) = '2019'
moderate
1,322
student_club
Among the events attended by more than 10 members of the Student_Club, how many of them are meetings?
meetings events refers to type = 'Meeting'; attended by more than 10 members refers to COUNT(event_id) > 10
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;
moderate
1,323
student_club
List all the names of events that had an attendance of over 20 students but were not fundraisers.
attendance of over 20 students means the event has more than 20 attendance records; fundraisers are events where type = 'Fundraiser'
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
moderate
1,324
student_club
What is the average attendance of meetings in 2020?
meetings in 2020 refers to type = 'Meeting' where YEAR(event_date) = 2020; average = DIVIDE(COUNT(event_id), COUNT(DISTINCT event_name))
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'
moderate
1,325
student_club
What is the most expensive item that was spent in support of club events?
item in support of club events refers to expense_description; most expensive refers to MAX(cost)
SELECT expense_description FROM expense ORDER BY cost DESC LIMIT 1
simple
1,326
student_club
How many members of the Student_Club have majored Environmental Engineering?
'Environmental Engineering' is the major name
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'
simple
1,327
student_club
List the full name of all the members of the Student_Club who attended the "Laugh Out Loud" event.
full name of members refers to first_name, last_name; 'Laugh Out Loud' is an event name;
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'
moderate
1,328
student_club
List the last name of all the students who majored Law and Constitutional Studies.
'Law and Constitutional Studies' is the major name
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'
simple
1,329
student_club
What county did Sherri Ramsey grew up?
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'
simple
1,330
student_club
What college offers the major that Tyler Hewitt took?
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'
simple
1,331
student_club
What is the amount of the funds that the Vice President received?
'Vice President' is a position of Student Club; funds received refers to amount.
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';
simple
1,332
student_club
How much did the Student_Club members spend on food in the September Meeting?
amount spent refers to spent; spend on food in September Meeting refers to category = 'Food' where event_name = 'September Meeting'
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'
moderate
1,333
student_club
What is the hometown city and state of the Student Club President?
'President' is a position of Student Club;
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'
simple
1,334
student_club
List the full name of the Student_Club members that grew up in Illinois state.
full name of member refers to first_name, last_name
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'
simple
1,335
student_club
How much did the Student_Club members spend on advertisement in September Meeting?
amount spent refers to spent; spend on food in September Meeting refers to category = 'Advertisement' where event_name = 'September Meeting'
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'
moderate
1,336
student_club
What department offers the major that Pierce and Guidi took?
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'
simple
1,337
student_club
What is the total budgeted amount for all category in "October Speaker" event?
total budgeted amount refers to SUM(amount) where event_name = 'October Speaker'
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'
simple
1,338
student_club
Was each expense in October Meeting on October 8, 2019 approved?
event_name = 'October Meeting' where event_date = '2019-10-08'; approved = True means expenses was approved; approved = False means expenses was not approved
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%'
moderate
1,339
student_club
Calculate the total average cost that Elijah Allen spent in the events on September and October.
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
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')
challenging
1,340
student_club
Calculate the difference of the total amount spent in all events by the Student_Club in year 2019 and 2020.
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)
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
moderate
1,341
student_club
Give the location for "Spring Budget Review".
'Spring Budget Review' is an event name;
SELECT location FROM event WHERE event_name = 'Spring Budget Review'
simple
1,342
student_club
What was the cost for the "Posters" on 2019/9/4?
'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04'
SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'
simple
1,343
student_club
With the biggest budget for the "Food", what was the remaining of it?
remaining of budget refers to remaining, biggest budget for 'Food' refers to MAX(budget.amount) where category = 'Food'
SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget WHERE category = 'Food' )
simple
1,344
student_club
What was the notes of the fundraising on 2019/9/14?
2019/9/14 refers to September 14, 2019
SELECT notes FROM income WHERE source = 'Fundraising' AND date_received = '2019-09-14'
simple
1,345
student_club
How many majors are there in "College of Humanities and Social Sciences"?
SELECT COUNT(major_name) FROM major WHERE college = 'College of Humanities and Social Sciences'
simple
1,346
student_club
Tell the phone number of "Carlo Jacobs".
Carlo Jacobs is the full name; full name refers to first_name, last_name;
SELECT phone FROM member WHERE first_name = 'Carlo' AND last_name = 'Jacobs'
simple
1,347
student_club
Tell the hometown county for "Adela O'Gallagher".
hometown county refers to county
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'
simple
1,348
student_club
For all the budgets for "November Meeting", how many of them had exceeded the budget?
'November Meeting' is an event name; remaining < 0 means the cost had exceeded the budget
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
simple
1,349
student_club
Provide the total number of the budget amount for "September Speaker" event.
'September Speaker' is an event name; total number of budget amount refers to SUM(amount)
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'
simple
1,350
student_club
What is the status of the event which bought "Post Cards, Posters" on 2019/8/20?
'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
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'
moderate
1,351
student_club
What was Brent Thomason's major?
Brent Thomason is the full name; full name refers to first_name, last_name; major refers to major_name
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'
simple
1,352
student_club
For all the club members from "Business" major, how many of them wear medium size t-shirt?
'Business' is a major name; wear medium size t-shirt refers to t_shirt_size = 'Medium'
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'
moderate
1,353
student_club
What's Christof Nielson's zip code type?
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'
simple
1,354
student_club
State the major name for the Vice President of the club.
'Vice President' is a position of Student Club
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'
simple
1,355
student_club
Where is the hometown state for "Sacha Harrison"?
hometown state refers to state;
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'
simple
1,356
student_club
Which department was the President of the club in?
'President' is a position of Student Club
SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position = 'President'
simple
1,357
student_club
State the date Connor Hilton paid his/her dues.
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';
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'
simple
1,358
student_club
Who was the first one paid his/her dues? Tell the full name.
Full name refers to first and last name; “first paid dues” means the earliest dues payment date.
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;
simple
1,359
student_club
How many times was the budget in Advertisement for "Yearly Kickoff" meeting more than "October Meeting"?
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'))
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'
challenging
1,360
student_club
What percentage was the budget for Parking to the total budget for the "November Speaker"?
DIVDE(SUM( amount where category = 'Parking' and event_name = 'November Speaker'), COUNT(event_name = 'November Speaker)) * 100
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'
moderate
1,361
student_club
What is the total cost of the pizzas for all the events?
total cost of the pizzas refers to SUM(cost) where expense_description = 'Pizza'
SELECT SUM(cost) FROM expense WHERE expense_description = 'Pizza'
simple
1,362
student_club
How many cities are there in Orange County, Virginia?
Orange County is the county name, Virginia is the state name
SELECT COUNT(city) FROM zip_code WHERE county = 'Orange County' AND state = 'Virginia'
simple
1,363
student_club
List all of the College of Humanities and Social Sciences' departments.
SELECT DISTINCT department FROM major WHERE college = 'College of Humanities and Social Sciences'
simple
1,364
student_club
Where is Amy Firth's hometown?
hometown refers to city, county, state
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'
simple
1,365
student_club
What are the expenses of the budget with the lowest remaining?
expense of budget refers to expense_description; lowest remaining refers to MIN(remaining)
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
simple
1,366
student_club
List all the members who attended the event "October Meeting".
'October Meeting' is an event name;
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'
simple
1,367
student_club
Which college do most of the members go to?
college most members go refers to MAX(COUNT(major.college))
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
simple
1,368
student_club
What does the person with the phone number "809-555-3360" major in?
[Remove Evidence]
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'
simple
1,369
student_club
Which event has the highest budget amount?
event refers to event_name; highest budget amount refers to MAX(amount)
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
simple
1,370
student_club
List all the expenses incurred by the vice president.
expense refers to expense_description; 'Vice President' is a position of the Student Club
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';
simple
1,371
student_club
How many members attended the "Women's Soccer" event?
'Women's Soccer' is the event name;
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'
simple
1,372
student_club
When did the member, Casey Mason, received the income?
when the income was received refers to date_received
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'
simple
1,373
student_club
How many of the members' hometowns are from Maryland state?
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';
simple
1,374
student_club
How many events did the member with the phone number "954-555-6240" attend?
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'
simple
1,375
student_club
List all the members of the "School of Applied Sciences, Technology and Education" department.
list all members means to list all the full name; full name refers to first_name, last_name;
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'
moderate
1,376
student_club
Among all the closed events, which event has the highest spend-to-budget ratio?
closed events refers to event_name where status = 'Closed'; highest spend-to budget ratio refers to MAX(DIVIDE(spent, amount))
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
moderate
1,377
student_club
How many student have the position of president?
'President' is a position of Student Club
SELECT COUNT(member_id) FROM member WHERE position = 'President'
simple
1,378
student_club
What is the highest amount of budget spend for an event?
highest amount of budget spend refers to MAX(spent)
SELECT MAX(spent) FROM budget
simple
1,379
student_club
How many meeting events were held in 2020?
meeting events refers to type = 'Meeting'; held in 2020 refers to YEAR(event_date) = 2020
SELECT COUNT(event_id) FROM event WHERE type = 'Meeting' AND SUBSTR(event_date, 1, 4) = '2020'
simple
1,380
student_club
What is the total amount of money spent for food?
total amount of money spent refers to SUM(spent); spent for food refers to category = 'Food'
SELECT SUM(spent) FROM budget WHERE category = 'Food'
simple
1,381
student_club
List the name of students that have attended more than 7 events.
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
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
moderate
1,382
student_club
Among the students majored in interior design, who have attended the Community Theater event?
majored in interior design refers to major_name = 'Interior Design'; 'Community Theater' is the event name;
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'
moderate
1,383
student_club
State the name of students from Georgetown, South Carolina.
name of students means the full name; Georgetown is a city; South Carolina is a state
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'
simple
1,384
student_club
How many income generated by Grant Gilmour?
income generated refers to income.amount
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'
simple
1,385
student_club
Which students were able to generate income more than $40?
name of students means first_name, last_name; generate income more than $40 refers to income.amount > 40
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
simple
1,386
student_club
What is the total expense for the Yearly Kickoff?
'Yearly Kickoff' is an event name; total expense refers to SUM(cost)
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'
simple
1,387
student_club
Which student has been entrusted to manage the budget for the Yearly Kickoff?
name of students means the full name; full name refers to first_name, last_name;'Yearly Kickoff' is an event name;
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'
moderate
1,388
student_club
Which students manage to generate the highest income. State his/her full name along with the income source.
full name refers to first_name, last_name; generate the highest income refers to the total income amount
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
moderate
1,389
student_club
Which event has the lowest cost?
event refers to event_name; lowest cost means MIN(cost)
SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget ORDER BY T3.cost LIMIT 1
simple
1,390
student_club
Based on the total cost for all event, what is the percentage of cost for Yearly Kickoff event?
percentage is the ratio of the cost for the 'Yearly Kickoff' event to the total cost of all events, multiplied by 100.
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
moderate
1,391
student_club
What is the ratio of students majoring in finance to those majoring in physics?
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).
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
simple
1,392
student_club
Indicate the top source of funds received in September 2019 based on their amount.
top source funds refers to MAX(source); September 2019 means date_received BETWEEN '2019-09-01' and '2019-09-30'
SELECT source FROM income WHERE date_received BETWEEN '2019-09-01' and '2019-09-30' ORDER BY source DESC LIMIT 1
simple
1,393
student_club
Provide the full name and email address of the Student_Club's Secretary.
full name refers to first_name, last_name; 'Secretary' is a position of Student Club
SELECT first_name, last_name, email FROM member WHERE position = 'Secretary'
simple
1,394
student_club
How many members of the Student_Club have major in 'Physics Teaching'?
'Physics Teaching' is the major_name;
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'
simple
1,395
student_club
How many members did attend the event 'Community Theater' in 2019?
event 'Community Theater' in 2019 refers to event_name = 'Community Theater' where YEAR(event_date) = 2019
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'
moderate
1,396
student_club
Provide the number of events attended by Luisa Guidi. What is her major?
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'
simple
1,397
student_club
On average, how much did the Student_Club spend on food for the typical event in the past?
DIVIDE(SUM(spent), COUNT(spent)) where category = 'Food'; 'event in the past' means event_status = 'Closed'
SELECT SUM(spent) / COUNT(spent) FROM budget WHERE category = 'Food' AND event_status = 'Closed'
simple
1,398
student_club
Name the event with the highest amount spent on advertisement.
advertisement refers to category = 'Advertisement'; highest amount spent refers to the maximum value in the spent column for advertisement category
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
moderate
1,399
student_club
Did Maya Mclean attend the 'Women's Soccer' event?
Maya Mclean is the full name; full name refers to first_name, last_name; 'Women's Soccer' is an event_name
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;
moderate