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