Chinastark/bird_dataset huggingface dataset:
Database: donor
Note: school "d4af834b1d3fc8061e1ee1b3f1a77b85" refers to schoolid = 'd4af834b1d3fc8061e1ee1b3f1a77b85'; donor is a teacher refers to is_teacher_acct = 't';
Question: Is the donor who donated to school "d4af834b1d3fc8061e1ee1b3f1a77b85" a teacher?
SQL: SELECT donations.is_teacher_acct FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.schoolid = 'd4af834b1d3fc8061e1ee1b3f1a77b85'
Database: donor
Note: donors are teachers refers to is_teacher_acct = 't'; Brooklyn is school_city; percentage = Divide(Count(school_city-'Brooklyn'),Count(school_city))*100;
Question: Among the schools whose donators are teachers, what is the percentage of schools that are in Brooklyn?
SQL: SELECT cast(sum(CASE WHEN projects.school_city LIKE 'Brooklyn' THEN 1 ELSE 0 END) AS REAL) * 100 / count(projects.teacher_acctid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE donations.is_teacher_acct = 't'
Database: donor
Note: donors are teachers refers to is_teacher_acct = 't'; affect more than 30 students refers to students_reached>30; Percentage = Divide(Count(students_reached>30), Count(students_reached))*100;
Question: Among the projects whose donators are teachers, what is the percentage of projects that affected more than 30 students?
SQL: SELECT cast(sum(CASE WHEN projects.students_reached > 30 THEN 1 ELSE 0 END) AS REAL) * 100 / count(projects.projectid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE donations.is_teacher_acct = 't'
Database: donor
Note: Bethlehem is school_city; suburban metro refers to school_metro = 'suburban';
Question: How many schools which have suburban metro are there in Bethlehem?
SQL: SELECT count(schoolid) FROM projects WHERE school_city = 'Bethlehem' AND school_metro = 'suburban'
Database: donor
Note: Los Angeles is school_city; year-round school refers to school_year_round = 't';
Question: What is the number of the year round school in Los Angeles?
SQL: SELECT count(school_year_round) FROM projects WHERE school_city = 'Los Angeles' AND school_year_round = 't'
Database: donor
Note: public magnet school refers to school_magnet = 't'; in New York Manhattan refers to school_country = 'New York(Manhattan)';
Question: State the number of public magnet schools in New York Manhattan.
SQL: SELECT count(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'
Database: donor
Note: Twin Falls is school_country; 'Math & Science' is primary_focus_area;
Question: How many teachers in Twin Falls have Math & Science as their primary focus area?
SQL: SELECT count(teacher_acctid) FROM projects WHERE school_county = 'Twin Falls' AND primary_focus_area = 'Math & Science'
Database: donor
Note: Literature & Writing' is primary_focus_subject; use 'Mr' as their teacher prefix refers to teacher_prefix = 'Mr';
Question: How many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?
SQL: SELECT count(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'
Database: donor
Note: teach 3-5 grades refers to grade_level = 'Grades 3-5'; 'Boston Public School District' is school_district;
Question: What is the total number of projects that was created by the teachers that teach 3-5 grades in Boston Public School District?
SQL: SELECT count(projectid) FROM projects WHERE school_district = 'Boston Public School District' AND grade_level = 'Grades 3-5'
Database: donor
Note: ABC Read' is the title; city refers to school_city;
Question: For the teacher who wrote the project 'ABC Read', which city was he/she in?
SQL: SELECT projects.school_city FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title = 'ABC Read'
Database: donor
Note: Creating Memories and Inspiring Dreams is title;
Question: What is the teacher prefix for the teacher who wrote the project 'Creating Memories and Inspiring Dreams'?
SQL: SELECT projects.teacher_prefix FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Creating Memories and Inspiring Dreams%'
Database: donor
Note: Calculate, Financial Security For Tomorrow Starts Today! ' is title; donor is a teacher refers to is_teacher_acct = 't';
Question: Is the donor of the project 'Calculate, Financial Security For Tomorrow Starts Today! ' a teacher?
SQL: SELECT donations.is_teacher_acct FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'Calculate, Financial Security For Tomorrow Starts Today! '
Database: donor
Question: What is the title for the project that got the donation message as "Donation on behalf of Matt Carpenter because I'm a strong believer in education".
SQL: SELECT essays.title FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE donations.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'
Database: donor
Note: A Rug For Reaching Readers'is the title;
Question: How many number of donations did the project 'A Rug For Reaching Readers' get?
SQL: SELECT sum(donations.donation_total) FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'A Rug For Reaching Readers'
Database: donor
Note: Engaging Young Readers with a Leveled Classroom Library' is the title; total donation amount = Add(donation_to_project, donation_optional_support);
Question: What is the total donation amount for the project 'Engaging Young Readers with a Leveled Classroom Library'?
SQL: SELECT sum(donations.donation_to_project) + sum(donations.donation_optional_support) FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'Engaging Young Readers with a Leveled Classroom Library '
Database: donor
Note: Armenian Genocide' is the title;
Question: What was the donation optional support amount for the project 'Armenian Genocide'?
SQL: SELECT donations.donation_optional_support FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'Armenian Genocide'
Database: donor
Note: donation at 14:44:29 on 2012/9/6 refers to donation_timestamp = '2012/9/6 14:44:29';
Question: State the short description for the project which got the donation at 14:44:29 on 2012/9/6.
SQL: SELECT essays.short_description FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE donations.donation_timestamp LIKE '2012-09-06 14:44:29'
Database: donor
Note: I Can't See It...Can You Help Me???' is the title;
Question: Did the project 'I Can't See It...Can You Help Me???' get the tip for the donation?
SQL: SELECT donations.donation_included_optional_support FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'I Can''t See It...Can You Help Me???'
Database: donor
Note: donation at 11:38:43 on 2008/7/29 refers to donation_timestamp = '2008/7/29 11:38:43'; teacher's account ID refers to teacher_acctid;
Question: What is the teacher's account ID for the project that got the donation at 11:38:43 on 2008/7/29 ?
SQL: SELECT essays.teacher_acctid FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE donations.donation_timestamp LIKE '2008-07-29 11:38:43.361'
Database: donor
Note: Virtual Aquarium Needs Help!' is the title;
Question: Show the school id for the project 'Virtual Aquarium Needs Help!'.
SQL: SELECT projects.schoolid FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Virtual Aquarium Needs Help!'
Database: donor
Note: biggest donation refers to donation_total = 'max';
Question: What was the title for the project which got the biggest donation?
SQL: SELECT essays.title FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE donations.donation_total = ( SELECT max(donation_total) FROM donations )
Database: donor
Note: Awesome Audiobooks Make Avid Readers' is the title; percentage = Divie(donation_optional_support, donation_total)*100;
Question: For the donation of the project 'Awesome Audiobooks Make Avid Readers', what was the percentage of the tip in the total amount?
SQL: SELECT cast(sum(donations.donation_optional_support) AS REAL) * 100 / sum(donations.donation_total) FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'Awesome Audiobooks Make Avid Readers'
Database: donor
Note: Bringing Drama to Life' is the title; Percentage = Divide(Count(payment_method = 'creditcard'), Count(projectid))*100;
Question: For the all donations to the project 'Bringing Drama to Life', what is the percentage of the donation is paid by credit card?
SQL: SELECT cast(sum(CASE WHEN donations.payment_method LIKE 'creditcard' THEN 1 ELSE 0 END) AS REAL) * 100 / count(donationid) FROM essays INNER JOIN donations ON essays.projectid = donations.projectid WHERE essays.title LIKE 'Bringing Drama to Life'
Database: donor
Question: What is the short description for the title Future Einsteins Of America?
SQL: SELECT short_description FROM essays WHERE title = 'Future Einsteins Of America'
Database: donor
Note: Family History Project refer to title, need statement refer to need_statement;
Question: Write down the need statement of Family History Project.
SQL: SELECT need_statement FROM essays WHERE title = 'Family History Project'
Database: donor
Note: suburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district;
Question: How many suburban metros are there in Livingston Parish School District?
SQL: SELECT count(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'
Database: donor
Note: vendor refer to vendor_name; Classroom Keepers Management Center refer to item_name;
Question: Name the vendors that sell the item Classroom Keepers Management Center.
SQL: SELECT DISTINCT vendor_name FROM resources WHERE item_name = 'Classroom Keepers Management Center'
Database: donor
Note: Sax Arts & Crafts refer to vendor_name; resource type available refer to project_resource_type;
Question: List the resource types available at Sax Arts & Crafts.
SQL: SELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Sax Arts & Crafts'
Database: donor
Note: New York refer to school_state = NY; highest number of low poverty level refer to MAX(poverty level = ’low poverty’);
Question: Which school county in the state of New York has a high number of low poverty levels?
SQL: SELECT school_county FROM projects WHERE poverty_level = 'low poverty' AND school_state = 'NY' GROUP BY school_state ORDER BY count(poverty_level) DESC LIMIT 1
Database: donor
Note: Future Einsteins of America refer to title;
Question: Which school district was Future Einsteins Of America project located at?
SQL: SELECT projects.school_district FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'Future Einsteins Of America'
Database: donor
Note: Needed Resource Materials For My Students refer to title;
Question: What payment method was used for Needed Resource Materials For My Students?
SQL: SELECT donations.payment_method FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE essays.title = 'Needed Resource Materials For My Students'
Database: donor
Note: paid via credit card refer to payment method = creditcard; Memphis City School District refer to school_district;
Question: How many donations were paid via credit card to Memphis City School District?
SQL: SELECT count(donations.projectid) FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.payment_method = 'creditcard' AND projects.school_district = 'Memphis City School District'
Database: donor
Note: Barnes and Noble refer to vendor_name;
Question: List the school districts that have bought resources from Barnes and Noble.
SQL: SELECT projects.school_district FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.vendor_name = 'Barnes and Noble'
Database: donor
Note: coordinates refer to (school_latitude, school_longitude); R & A Plant Genetics refer to item_name; Benchmark Education refer to vendor_name;
Question: Give the coordinates of the buyer of R & A Plant Genetics from Benchmark Education.
SQL: SELECT projects.school_latitude, projects.school_longitude FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.item_name = 'R & A Plant Genetics' AND resources.vendor_name = 'Benchmark Education'
Database: donor
Note: Georgia refer to school_state = 'GA';
Question: Which payment method is most comonly used by the schools in the state of Georgia for the payment of donations?
SQL: SELECT donations.payment_method FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE projects.school_state = 'GA' GROUP BY projects.school_state ORDER BY count(donations.payment_method) DESC LIMIT 1
Database: donor
Note: Coordinates of the school refer to school_latitude, school_longitude); Look, Look, We Need a Nook! Refer to title;
Question: What are the coordinates of the school where project 'Look, Look, We Need a Nook!' Was donated to and what resource type is it?
SQL: SELECT projects.school_latitude, projects.school_longitude, projects.resource_type FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Look, Look, We Need a Nook!'
Database: donor
Note: message refer to donation_message; Newark School District refer to school_district; 40.735332, -74.196014 refer to (school latitude, school_longitude);
Question: Write the messages of those who donated to the Newark School District in the coordinates of 40.735332, -74.196014.
SQL: SELECT donations.donation_message FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE projects.school_latitude = 40.735332 AND projects.school_longitude = -74.196014 AND projects.school_district = 'Newark School District'
Database: donor
Note: date refer to date_posted; Lets Share Ideas refer to title;
Question: What date did the project with he 'Lets Share Ideas essay' went live?
SQL: SELECT projects.date_posted FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'Lets Share Ideas'
Database: donor
Note: message of the donor refer to donation_message; Lets Share Ideas refer to title; paid with a credit card refer to payment_method;
Question: Write the message of the donor of the project with the title of Lets Share Ideas who paid with a credit card.
SQL: SELECT donations.donation_message FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE essays.title = 'Lets Share Ideas' AND donations.payment_method = 'creditcard'
Database: donor
Note: resource type refer to project_resource_type; most commonly bought refer to COUNT(project_resource_type where school_district = ’Los Angeles Unif Sch Dist’); Los Angeles Unified School District refer to school_district = ’Los Angeles Unif Sch Dist’;
Question: Which resource type is commonly bought by the Los Angeles Unified School District?
SQL: SELECT resources.project_resource_type FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_district = 'Los Angeles Unif Sch Dist' GROUP BY projects.school_district ORDER BY count(resources.project_resource_type) DESC LIMIT 1
Database: donor
Note: cities refer to school_city; Los Angeles Unified School District refer to school_district = 'Los Angeles Unified School District'; supplies refer to project_resource_type; Quill.com refer to vendor_name;
Question: Which cities in the Los Angeles Unified School District has bought supplies from Quill.com?
SQL: SELECT projects.school_city FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_district = 'Los Angeles Unif Sch Dist' AND resources.vendor_name = 'Quill.com'
Database: donor
Note: ABC School Supply refer to vendor_name; listed type as Other refer to project_resource_type = 'Other'; coordinates refer to coordinates(school_latitude, school_longitude); total price of items refer to SUM(MULTIPLY(item_unit_price, item_quantity where vendor_name = ’ABC School Supply’));
Question: What is the total price of items brought from ABC School Supply with a listed type of Other? Also include the list of the buyers' coordinates and school districts they belong to.
SQL: SELECT resources.item_unit_price * resources.item_quantity price, projects.school_latitude, projects.school_longitude FROM projects INNER JOIN resources ON projects.projectid = resources.projectid WHERE resources.vendor_name = 'ABC School Supply' AND resources.project_resource_type = 'Other' AND projects.school_district = 'Hillsborough Co Pub Sch Dist'
Database: donor
Note: paypal refer to payment method; Lets Share Ideas refer to title; city refer to school_city; total amount donated refer to SUM(donation_total of paypal where payment_method = ’paypal’);
Question: Calculate the sum of all the total amount donated to the essay project titled 'Lets Share Ideas' which were paid through paypal and indicate the city and poverty level.
SQL: SELECT sum(donations.donation_total), school_city, poverty_level FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE essays.title = 'Lets Share Ideas' AND donations.payment_method = 'paypal'
Database: donor
Note: city of Pocatello refers to donor_city = 'Pocatello'; not teachers refers to is_teacher_acct = 'f';
Question: How many donors who donated to the city of Pocatello are not teachers?
SQL: SELECT count(donationid) FROM donations WHERE donor_city = 'Pocatello' AND is_teacher_acct = 'f'
Database: donor
Note: Suffolk County refers to school_county = 'Suffolk'; Ph.D. teachers refers to teacher_prefix = 'Dr.';
Question: How many schools in Suffolk County have Ph.D. teachers?
SQL: SELECT count(schoolid) FROM projects WHERE teacher_prefix = 'Dr.' AND school_county = 'Suffolk'
Database: donor
Note: paid through Amazon refers to payment_method = 'Amazon'; sum of the total donated amounts refers to SUM(donation_to_project,donation_optional_support);
Question: What is the sum of the total donated amounts paid through Amazon?
SQL: SELECT sum(donation_to_project) + sum(donation_optional_support) FROM donations WHERE payment_method = 'amazon'
Database: donor
Note: an honoree refers to for_honoree = 't'; more than $100 refers to dollar_amount = '100_and_up';
Question: How many donations of more than $100 were made for an honoree?
SQL: SELECT count(donationid) FROM donations WHERE dollar_amount = '100_and_up' AND for_honoree = 't'
Database: donor
Note: unit price less than 15 refers to item_unit_price<= 15; are not technology type refers to project_resource_type = 'technology';
Question: How many resources with a unit price less than 15 are not technology type? List them by vendor id
SQL: SELECT vendorid FROM resources WHERE project_resource_type = 'Technology' AND item_unit_price <= 15
Database: donor
Note: ordered between 5 to 10 items refers to item_quantity between 5 and 10; are from Quill.com refers to vendor_name = 'Quill.com';
Question: On how many projects where the teacher has ordered between 5 to 10 items are from are from Quill.com?
SQL: SELECT count(projectid) FROM resources WHERE vendor_name = 'Quill.com' AND item_quantity BETWEEN 5 AND 10
Database: donor
Note: located in the Union Pub School District I-9 refers to school_district = 'Union Pub School District I-9'; New York teaching fellow refers to teacher_ny_teaching_fellow = 't';
Question: List by school id projects from schools located in the Union Pub School District I-9 that have a New York teaching fellow
SQL: SELECT schoolid FROM projects WHERE school_district = 'Union Pub School District I-9' AND teacher_ny_teaching_fellow = 't'
Database: donor
Note: Los Angeles County refers to school_county = 'Los Angeles';
Question: In which cities are Los Angeles County Suburban Metro Schools located?
SQL: SELECT school_city FROM projects WHERE school_metro = 'suburban' AND school_county = 'Los Angeles'
Database: donor
Note: book-type projects refers to project_resource_type = 'Books';
Question: What are the vendors of the book-type projects? List them with the project ID.
SQL: SELECT DISTINCT vendorid, projectid FROM resources WHERE project_resource_type = 'Books'
Database: donor
Note: have not received a cash donation refers to payment_method = 'no_cash_received'; received a portion of a donation included corporate sponsored giftcard payment_included_campaign_gift_card = 't'; percentage refers to DIVIDE(payment_included_campaign_gift_card = 't',payment_included_campaign_gift_card)*100;
Question: What percentage of projects that have not received a cash donation have received a portion of a donation included corporate sponsored giftcard?
SQL: SELECT cast(sum(CASE WHEN payment_included_campaign_gift_card = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / count(donationid) FROM donations WHERE payment_method = 'no_cash_received'
Database: donor
Note: City of Santa Barbara refers to school_city = 'Santa Barbara'; percentage refers to DIVIDE(school_metro = 'suburban'; school_metro)*100;
Question: What percentage of projects in the City of Santa Barbara are in suburban metro?
SQL: SELECT cast(sum(CASE WHEN school_metro = 'suburban' THEN 1 ELSE 0 END) AS REAL) * 100 / count(projectid) FROM projects WHERE school_city = 'Santa Barbara'
Database: donor
Note: made in March 2013 refers to substr(donation_timestamp,1,7) = '2013-03'; percentage refers to DIVIDE(SUM(payment_method made in March 2013), SUM(payment_method))*100;
Question: What is the percentage of payment methods of donations made in March 2013?
SQL: SELECT payment_method , cast(count(donationid) AS REAL) * 100 / 51090 FROM donations WHERE donation_timestamp LIKE '2013-03%' GROUP BY payment_method
Database: donor
Note: AKJ Books items refers to vendor_name = 'AKJ Books'; average unit price refers to DIVIDE(sum(item_unit_price),count(resourceid));
Question: What is the average unit price of AKJ Books items?
SQL: SELECT sum(item_unit_price) / sum(item_quantity) FROM resources WHERE vendor_name = 'AKJ Books'
Database: donor
Note: in Brooklyn refers to school_city = 'Brooklyn'; urban metro refers to school_metro = 'urban'; donations for an honoree refers to for_honoree = 't'; requested TT992 - Refill Pack for Safety Name Tags refers to item_name = 'TT992 - Refill Pack for Safety Name Tags';
Question: How many schools in Brooklyn with urban metro and donations for an honoree have requested TT992 - Refill Pack for Safety Name Tags as a resource?
SQL: SELECT count(projects.schoolid) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city = 'Brooklyn' AND projects.school_metro = 'urban' AND donations.for_honoree = 't' AND resources.item_name = 'TT992 - Refill Pack for Safety Name Tags'
Database: donor
Note: highest level of poverty refers to poverty_level = 'highest'; received a portion of a donation included corporate sponsored gift card refers to payment_included_campaign_gift_card = 't';
Question: How many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?
SQL: SELECT count(projects.schoolid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE donations.payment_included_campaign_gift_card = 't' AND projects.poverty_level = 'highest poverty'