1sf/bird-sql-dev-xresults huggingface dataset:
Database: thrombosis_prediction
Question: For the patient with an abnormal alkaliphophatase level, how many of them are admitted to the hospital?
Evidence: abnormal alkaliphophatase level refers to ALP > = 300; admitted to the hospital refers to Admission = '+';
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP >= 300 AND T1.Admission = '+'
Database: thrombosis_prediction
Question: Among the patients followed at the outpatient clinic, how many of them have a normal level of alkaliphophatase?
Evidence: followed at the outpatient clinic refers to Admission = '-'; normal level of alkaliphophatase refers to ALP < 300;
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP < 300 AND T1.Admission = '-'
Database: thrombosis_prediction
Question: Please list the diagnosis of the patients whose total protein is lower than normal.
Evidence: total protein is lower than normal refers to TP < 6.0;
SQL: SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0
Database: thrombosis_prediction
Question: For the patients who are diagnosed with SJS, how many of them have a normal level of total protein?
Evidence: diagnosed with SJS refers to Diagnosis = 'SJS'; normal level of total protein refers to TP > 6.0 and TP < 8.5;
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SJS' AND T2.TP > 6.0 AND T2.TP < 8.5
Database: thrombosis_prediction
Question: What is the examination date of the patient whose albumin is the highest in the normal range?
Evidence: examination date refers to Date; albumin is the highest in the normal range refers to MAX(ALB > 3.5 and ALB < 5.5);
SQL: SELECT Date FROM Laboratory WHERE ALB > 3.5 AND ALB < 5.5 ORDER BY ALB DESC LIMIT 1
Database: thrombosis_prediction
Question: How many male patients have a normal level of both albumin and total protein?
Evidence: male refers to Sex = 'M'; normal level of both albumin and total protein refers to ALB > 3.5 and ALB < 5.5 AND TP between 6.0 and 8.5;
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M'  AND T2.ALB > 3.5 AND T2.ALB < 5.5 AND T2.TP BETWEEN 6.0 AND 8.5
Database: thrombosis_prediction
Question: What is the anti Cardiolipin antibody concentration of the female patient with the highest uric acid level in the normal range?
Evidence: anti Cardiolipin antibody concentration refers to `aCL IgG`, `aCL IgM`, `aCL IgA`; female patient refers to Sex = F'; highest uric acid level in the normal range refers to MAX(UA > 6.50);
SQL: SELECT T3.`aCL IgG`, T3.`aCL IgM`, T3.`aCL IgA` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T1.SEX = 'F' AND T2.UA > 6.5 ORDER BY T2.UA DESC LIMIT 1
Database: thrombosis_prediction
Question: What is the highest anti-nucleus antibody concentration level of a patient with a normal creatinine level?
Evidence: highest anti-nucleus antibody concentration level refers to MAX(ANA); normal creatinine level refers to CRE < 1.5;
SQL: SELECT T2.ANA FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 ON T1.ID = T3.ID WHERE T3.CRE < 1.5 ORDER BY T2.ANA DESC LIMIT 1
Database: thrombosis_prediction
Question: Please list the patient's ID whose creatinine level is normal and whose anti Cardiolipin antibody concentration level is the highest.
Evidence: creatinine level is normal refers to CRE < 1.5; anti Cardiolipin antibody concentration level is the highest refers to MAX(aCL IgA);
SQL: SELECT T2.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.CRE < 1.5 ORDER BY T2.`aCL IgA` DESC LIMIT 1
Database: thrombosis_prediction
Question: Among the patients whose total bilirubin is over the normal range, how many of them have a peripheral pattern observed in the sheet of ANA examination?
Evidence: total bilirubin is over the normal range refers to `T-BIL` > = 2.0; peripheral pattern is observed in the sheet of ANA examination refers to that ANA Pattern contains 'P';
SQL: 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.`T-BIL` >= 2 AND T3.`ANA Pattern` LIKE '%P%'
Database: thrombosis_prediction
Question: What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range?
Evidence: anti-nucleus antibody concentration refers to ANA; total bilirubin is the highest in the normal range refers to MAX(`T-BIL` < 2.0);
SQL: SELECT T3.ANA 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.`T-BIL` < 2.0 ORDER BY T2.`T-BIL` DESC LIMIT 1
Database: thrombosis_prediction
Question: For the patients whose total cholesterol is higher than normal, how many of them have a negative measure of degree of coagulation?
Evidence: total cholesterol is higher than normal refers to `T-CHO` > = 250; negative measure of degree of coagulation refers to KCT = '-' ;
SQL: 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.`T-CHO` >= 250 AND T3.KCT = '-'
Database: thrombosis_prediction
Question: Among the patients whose total cholesterol is within the normal range, how many of them have a P pattern observed in the sheet of ANA examination?
Evidence: total cholesterol is within the normal range refers to `T-CHO` < 250; P pattern observed in the sheet of ANA examination refers to ANA Pattern = 'P';
SQL: 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 T3.`ANA Pattern` = 'P' AND T2.`T-CHO` < 250
Database: thrombosis_prediction
Question: Among the patients with the normal level of triglyceride, how many of them have other symptoms observed?
Evidence: normal level of triglyceride refers to TG < 200; have other symptoms refers to Symptoms is not null;
SQL: SELECT COUNT(T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 AND T1.Symptoms IS NOT NULL
Database: thrombosis_prediction
Question: What is the disease name of the patient who has the highest level of triglyceride within the normal range?
Evidence: disease name referse to Diagnosis; highest level of triglyceride within the normal range refers to MAX(TG < 200);
SQL: 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
Database: thrombosis_prediction
Question: Please list the IDs of the patients with no thrombosis and an abnormal level of creatinine phosphokinase.
Evidence: no thrombosis refers to Thrombosis = 0 ; abnormal level of creatinine phosphokinase refers to CPK < 250;
SQL: 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
Database: thrombosis_prediction
Question: For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation?
Evidence: normal range of creatinine phosphokinase refers to CPK < 250; positive measure of degree of coagulation refers to KCT = '+' or RVVT = '+' or LAC = '+' ;
SQL: 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 = '+')
Database: thrombosis_prediction
Question: When is the birthday of the oldest patient whose blood glucose is abnormal?
Evidence: oldest patient refers to MIN(Birthday); blood glucose is abnormal refers to GLU > 180;
SQL: 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
Database: thrombosis_prediction
Question: Among the patients with a normal blood glucose, how many of them don't have thrombosis?
Evidence: normal blood glucose refers to GLU < 180; don't have thrombosis refers to Thrombosis = 0;
SQL: 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
Database: thrombosis_prediction
Question: How many patients accepted to the hospital have a normal level of white blood cells?
Evidence: accepted to the hospital refers to Admission = '+'; normal level of white blood cells refers to WBC between 3.5 and 9.0;
SQL: 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 = '+'
Database: thrombosis_prediction
Question: How many patients diagnosed with SLE have a normal white blood cell level?
Evidence: diagnosed with SLE refers to Diagnosis = 'SLE'; normal white blood cell level refers to WBC between 3.5 and 9.0;
SQL: 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
Database: thrombosis_prediction
Question: 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.
Evidence: 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 = '-';
SQL: 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 = '-'
Database: thrombosis_prediction
Question: Among the patients who have a normal platelet level, how many of them have other symptoms observed?
Evidence: normal platelet level refers to PLT > 100 and PLT < 400; have other symptoms refers to Diagnosis is not null;
SQL: 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
Database: thrombosis_prediction
Question: Please list a patient's platelet level if it is within the normal range and if he or she is diagnosed with MCTD.
Evidence: 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';
SQL: 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
Database: thrombosis_prediction
Question: For the male patients that have a normal prothrombin time, what is their average prothrombin time?
Evidence: male refers to Sex = 'M'; normal prothrombin time refer to PT < 14; average prothrombin time = AVG(PT);
SQL: 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'
Database: thrombosis_prediction
Question: How many patients with severe thrombosis have a normal prothrombin time?
Evidence: severe thrombosis refers to Thrombosis = 2 or 1; normal prothrombin time refers to PT < 14;
SQL: 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
Database: student_club
Question: What's Angela Sanders's major?
Evidence: Angela Sanders is the full name; full name refers to first_name, last_name; major refers to major_name.
SQL: SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Angela' AND T1.last_name = 'Sanders'
Database: student_club
Question: Please list the full names of the students in the Student_Club that come from the Art and Design Department.
Evidence: full name refers to first_name, last_name;
SQL: SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.department = 'Art and Design Department'
Database: student_club
Question: How many students of the Student_Club have attended the event "Women's Soccer"?
Evidence: Women's Soccer is an event name
SQL: 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'
Database: student_club
Question: Please list the phone numbers of the students from the Student_Club that has attended the event "Women's Soccer".
Evidence: Women's Soccer is an event name; phone numbers refers to phone
SQL: 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'
Database: student_club
Question: 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?
Evidence: Women's Soccer is an event name; T-shirt that is in medium size refers to t_shirt_size = 'Medium'
SQL: 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'
Database: student_club
Question: What is the event that has the highest attendance of the students from the Student_Club?
Evidence: event with highest attendance refers to MAX(COUNT(link_to_event))
SQL: 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
Database: student_club
Question: Which college is the vice president of the Student_Club from?
Evidence: Vice President is a position of the Student Club
SQL: 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'
Database: student_club
Question: How many events of the Student_Club did Sacha Harrison attend in 2019?
Evidence: events attended in 2019 refers to YEAR(event_date) = 2019
SQL: 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'
Database: student_club
Question: Among the events attended by more than 10 members of the Student_Club, how many of them are meetings?
Evidence: meetings events refers to type = 'Meeting'; attended by more than 10 members refers to COUNT(event_id) > 10
SQL: SELECT 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) > 10 EXCEPT SELECT T1.event_name  FROM event AS T1  WHERE T1.type = 'Meeting'
Database: student_club
Question: List all the names of events that had an attendance of over 20 students but were not fundraisers.
Evidence: name of events refers to event_name; attendance of over 20 students COUNT(event_id) > 20.
SQL: 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 EXCEPT SELECT T1.event_name FROM event AS T1  WHERE T1.type = 'Fundraiser'
Database: student_club
Question: What is the average attendance of meetings in 2020?
Evidence: meetings in 2020 refers to type = 'Meeting' where YEAR(event_date) = 2020; average = DIVIDE(COUNT(event_id), COUNT(DISTINCT event_name))
SQL: SELECT CAST(COUNT(T2.link_to_event) AS REAL) / COUNT(DISTINCT T2.link_to_event) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE SUBSTR(T1.event_date, 1, 4) = '2020' AND T1.type = 'Meeting'
Database: student_club
Question: What is the most expensive item that was spent in support of club events?
Evidence: item in support of club events refers to expense_description; most expensive refers to MAX(cost)
SQL: SELECT expense_description FROM expense ORDER BY cost DESC LIMIT 1
Database: student_club
Question: How many members of the Student_Club have majored Environmental Engineering?

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

Evidence: 'Law and Constitutional Studies' is the major name
SQL: SELECT T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.major_name = 'Law and Constitutional Studies'
Database: student_club
Question: What is the amount of the funds that the Vice President received?
Evidence: 'Vice President' is a position of Student Club; funds received refers to amount.
SQL: SELECT T2.amount FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.position = 'Vice President'
Database: student_club
Question: How much did the Student_Club members spend on food in September Meeting?
Evidence: amount spent refers to spent; spend on food in September Meeting refers to category = 'Food' where event_name = 'September Meeting'
SQL: SELECT T2.spent FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'September Meeting' AND T2.category = 'Food' AND SUBSTR(T1.event_date, 6, 2) = '09'
Database: student_club
Question: What city and state did the President of the Student_Club grow up?
Evidence: 'President' is a position of Student Club;
SQL: SELECT T2.city, T2.state FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.position = 'President'
Database: student_club
Question: List the full name of the Student_Club members that grew up in Illinois state.
Evidence: full name of member refers to first_name, last_name
SQL: SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.state = 'Illinois'
Database: student_club
Question: How much did the Student_Club members spend on advertisement in September Meeting?
Evidence: amount spent refers to spent; spend on food in September Meeting refers to category = 'Advertisement' where event_name = 'September Meeting'
SQL: SELECT T2.spent FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'September Meeting' AND T2.category = 'Advertisement' AND SUBSTR(T1.event_date, 6, 2) = '09'
Database: student_club
Question: What department offers the major that Pierce and Guidi took?
SQL: SELECT T2.department FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.last_name = 'Pierce' OR T1.last_name = 'Guidi'
Database: student_club
Question: What is the total budgeted amount for all category in "October Speaker" event?
Evidence: total budgeted amount refers to SUM(amount) where event_name = 'October Speaker'
SQL: SELECT SUM(T2.amount) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'October Speaker'
Database: student_club
Question: Was each expense in October Meeting on October 8, 2019 approved?
Evidence: event_name = 'October Meeting' where event_date = '2019-10-08'; approved = True means expenses was approved; approved = False means expenses was not approved
SQL: SELECT T3.approved FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'October Meeting' AND T1.event_date LIKE '2019-10-08%'
Database: student_club
Question: Calculate the total average cost that Elijah Allen spent in the events on September and October.
Evidence: Elijah Allen is the full name; full name refers to first_name, last_name; The 5th and 6th string of the expense_date in the expense table can refer to month; events in September and October refers to month(expense_date) = 9 OR month(expense_date) = 10
SQL: SELECT AVG(T2.cost) FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.last_name = 'Allen' AND T1.first_name = 'Elijah' AND (SUBSTR(T2.expense_date, 6, 2) = '09' OR SUBSTR(T2.expense_date, 6, 2) = '10')
Database: student_club
Question: Calculate the difference of the total amount spent in all events by the Student_Club in year 2019 and 2020.
Evidence: The first 4 strings of the event_date values in the event table can represent year; The difference of the total amount spent = SUBTRACT(spent where YEAR(event_date) = 2019, spent where YEAR(event_date) = 2020)
SQL: SELECT SUM(CASE WHEN SUBSTR(T1.event_date, 1, 4) = '2019' THEN T2.spent ELSE 0 END) - SUM(CASE WHEN SUBSTR(T1.event_date, 1, 4) = '2020' THEN T2.spent ELSE 0 END) AS num FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event
Database: student_club
Question: Give the location for "Spring Budget Review".
Evidence: 'Spring Budget Review' is an event name;
SQL: SELECT location FROM event WHERE event_name = 'Spring Budget Review'
Database: student_club
Question: What was the cost for the "Posters" on 2019/9/4?
Evidence: 'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04'
SQL: SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'
Database: student_club
Question: With the biggest budget for the "Food", what was the remaining of it?
Evidence: remaining of budget refers to remaining, biggest budget for 'Food' refers to MAX(budget.amount) where category = 'Food'
SQL: SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget WHERE category = 'Food' )
Database: student_club
Question: What was the notes of the fundraising on 2019/9/14?
Evidence: fundraising on 2019/9/14 refers to source = 'Fundraising' where date_received = '2019-09-14'
SQL: SELECT notes FROM income WHERE source = 'Fundraising' AND date_received = '2019-09-14'
Database: student_club
Question: Tell the phone number of "Carlo Jacobs".
Evidence: Carlo Jacobs is the full name; full name refers to first_name, last_name;
SQL: SELECT phone FROM member WHERE first_name = 'Carlo' AND last_name = 'Jacobs'
Database: student_club
Question: Tell the hometown county for "Adela O'Gallagher".
Evidence: hometown county refers to county
SQL: SELECT T2.county FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T1.first_name = 'Adela' AND T1.last_name = 'O''Gallagher'
Database: student_club
Question: For all the budgets for "November Meeting", how many of them had exceeded the budget?
Evidence: 'November Meeting' is an event name; remaining < 0 means the cost had exceeded the budget
SQL: SELECT COUNT(T2.event_id) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'November Meeting' AND T1.remaining < 0
Database: student_club
Question: Provide the total number of the budget amount for "September Speaker" event.
Evidence: 'September Speaker' is an event name; total number of budget amount refers to SUM(amount)
SQL: SELECT SUM(T1.amount) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'September Speaker'
Database: student_club
Question: What is the status of the event which bought "Post Cards, Posters" on 2019/8/20?
Evidence: 'Post Cards, Posters' is an expense description; on 2019/8/20 refers to expense_date = '2019-8-20'; status of event refers to event_status
SQL: SELECT T1.event_status FROM budget AS T1 INNER JOIN expense AS T2 ON T1.budget_id = T2.link_to_budget WHERE T2.expense_description = 'Post Cards, Posters' AND T2.expense_date = '2019-08-20'