Chinastark/bird_dataset huggingface dataset:
Database: donor
Note: resources that were requested refers to item_name; project "d6ef27c07c30c81f0c16c32b6acfa2ff" refers to projectid = 'd6ef27c07c30c81f0c16c32b6acfa2ff'; quantities refers to item_quantity; teacher_prefix = 'Dr. ' refers to teacher acquired P.h.D or doctor degree;
Question: What were the resources that were requested by the teacher for project "d6ef27c07c30c81f0c16c32b6acfa2ff"? Indicate the quantities as well and whether or not the teacher acquired P.h.D or doctor degree.
SQL: SELECT DISTINCT resources.item_name, resources.item_quantity, projects.teacher_prefix FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.projectid = 'd6ef27c07c30c81f0c16c32b6acfa2ff'
Database: donor
Question: What is the total price including optional support received by the teacher who posted the essay titled "Recording Rockin' Readers"?
SQL: SELECT sum(projects.total_price_including_optional_support) FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title = 'Recording Rockin'' Readers'
Database: donor
Note: wrote "Smile for the Camera!!!" refers to title = 'Smile for the Camera!!!'; latitude refers to school_latitude; longitude refers to school_longitude;
Question: What is the latitude and longitude of the school where the teacher who wrote "Smile for the Camera!!!" teaches?
SQL: SELECT projects.school_latitude, projects.school_longitude FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title = 'Smile for the Camera!!!'
Database: donor
Note: total amount of all the donations refers to sum(donation_total); highest donation refers to max(donation_total);
Question: What is the total amount of all the donations made by the donor who made the highest donation in a single amount? Indicate the essay title to where he/she made his/her biggest donation.
SQL: SELECT donations.donation_total, 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: favorite project type refers to project_resource_type; top donors refers to max(donation_total);
Question: What are the favorite project types of each of the top 10 donors?
SQL: SELECT project_resource_type FROM ( SELECT donations.donor_acctid, resources.project_resource_type FROM donations INNER JOIN projects ON donations.projectid = projects.projectid INNER JOIN resources ON projects.projectid = resources.projectid ORDER BY donations.donation_total DESC LIMIT 10 ) GROUP BY project_resource_type ORDER BY count(project_resource_type) DESC LIMIT 1
Database: donor
Note: first ever project refers to min(date_posted); names of the resources refers to item_name;
Question: When was the first ever project went live on the site and what were the names of the resources being requested? If there are multiple projects that have the same date, indicate each of them and their items.
SQL: SELECT projects.date_posted, resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.date_posted = ( SELECT date_posted FROM projects ORDER BY date_posted ASC LIMIT 1 )
Database: donor
Note: project "iMath" refers to title = 'iMath';
Question: What is the name of the vendor that supplies resources to the project "iMath"?
SQL: SELECT DISTINCT resources.vendor_name FROM resources INNER JOIN essays ON resources.projectid = essays.projectid WHERE essays.title = 'iMath'
Database: donor
Note: project with the highest quantity refers to max(item_quantity);
Question: When was the project with the highest quantity went live on the site? Indicate the grade level for which the project materials are intended.
SQL: SELECT projects.date_posted, projects.grade_level FROM resources INNER JOIN projects ON resources.projectid = projects.projectid ORDER BY resources.item_quantity DESC LIMIT 1
Database: donor
Note: average amount of donations = divide(sum(donation_to_project), count(donor_acctid)); project "Recording Rockin' Readers" refers to title = 'Recording Rockin' Readers';
Question: What is the average amount of donations by people who donated in the project "Recording Rockin' Readers"
SQL: SELECT avg(donations.donation_to_project) FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE essays.title = 'Recording Rockin'' Readers'
Database: donor
Note: highest total price excluding optional support refers to max(total_price_excluding_optional_support); who refers to donor_acctid; percent = divide(donation_to_project, total_price_excluding_optional_support)*100%;
Question: What is the essay title of the project that have the highest total price excluding optional support and who is the biggest donor? Identify the donor and calculate how many percent did he/she donated in the project.
SQL: SELECT essays.title, donations.donor_acctid, cast(donations.donation_to_project AS REAL) / projects.total_price_excluding_optional_support FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid ORDER BY donations.donation_to_project DESC LIMIT 1
Database: donor
Note: which state refers to school_state; highest cost of optional support refers to max(donation_optional_support); average cost of optional support = avg(donation_optional_support);
Question: From which state do the 5 biggest donor, who gave the highest cost of optional support, come from? List their donor_acctid and calculate for their average cost of optional support for every donations they make and identtify the project's type of resource to which they gave the hightest optional support.
SQL: SELECT projects.school_state, donations.donor_acctid, avg(donations.donation_optional_support), projects.resource_type FROM projects INNER JOIN donations ON projects.projectid = donations.projectid ORDER BY donations.donation_optional_support DESC LIMIT 5
Database: donor
Note: in Brooklyn refers to school_city = 'Brooklyn'; highest request of resources refers to max(count(T1.item_name));
Question: Which project in Brooklyn that have the highest request of resources? State the the project ID including all of the name of item requested.
SQL: SELECT resources.projectid, resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_city LIKE 'Brooklyn' GROUP BY resources.item_name ORDER BY count(resources.item_name) DESC LIMIT 1
Database: donor
Note: urban area refers to school_metro = 'urban'; books resources refers to project_resource_type = 'Books';
Question: How many schools in urban area requested for books resources?
SQL: SELECT count(projects.schoolid) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.resource_type = 'Books' AND projects.school_metro = 'urban'
Database: donor
Note: highest amount of resources refers to max(count(schoolid)); Amazon refers to vendor_name = 'Amazon';
Question: Which school requested the highest amount of resources from Amazon? State the school's ID.
SQL: SELECT projects.schoolid FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.vendor_name LIKE 'Amazon' GROUP BY projects.schoolid ORDER BY count(resources.vendor_name) DESC LIMIT 1
Database: donor
Note: in Los Angeles refers to donor_city = 'Los Angeles'; school in another city refers to school_city ! = 'Los Angeles';
Question: How many donors in Los Angeles donated to school in another city?
SQL: SELECT count(projects.schoolid) FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.donor_city = 'Los Angeles' AND projects.school_city NOT LIKE 'Los Angeles'
Database: donor
Note: Reading About Other Cultures' project refers to title = 'Reading About Other Cultures'; prefix for the teacher refers to teacher_prefix;
Question: What is the prefix for the teacher who handled the 'Reading About Other Cultures' project?
SQL: SELECT projects.teacher_prefix FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Reading About Other Cultures'
Database: donor
Note: how many students refers to students_reached; Fit Firsties! project refers to title = 'Fit Firsties!';
Question: How many students will be impacted for the Fit Firsties! Project?
SQL: SELECT projects.students_reached FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Fit Firsties!'
Database: donor
Note: in Chicago refers to school_city = 'Chicago'; ID of the donor refers to donor_acctid;
Question: List the title of all projects located in Chicago along with the ID of the donor.
SQL: SELECT essays.title, donations.donor_acctid FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city LIKE 'Chicago'
Database: donor
Note: eachers with Doctor Degree refers to teacher_prefix = 'Dr.'; more than 300 students involved refers to students_reached > 300;
Question: Which projects created by teachers with Doctor Degree where the project have more than 300 students involved. List down the title of the project.
SQL: SELECT essays.title FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE projects.teacher_prefix LIKE 'Dr.' AND projects.students_reached > 300
Database: donor
Note: literacy subject as primary focus refers to primary_focus_subject = 'Literacy';
Question: State the name of vendor that supplies book resources to all school with literacy subject as their primary focus.
SQL: SELECT DISTINCT resources.vendor_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.primary_focus_subject LIKE 'Literacy'
Database: donor
Note: the most expensive funds refers to max(multiply(item_unit_price, item_quantity));
Question: What is the title of project that have the most expensive funds?
SQL: SELECT essays.title FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE projects.projectid = ( SELECT projectid FROM resources ORDER BY item_unit_price * item_quantity DESC LIMIT 1 )
Database: donor
Note: from New York refers to donor_city = 'New York'; donor is a teacher refers to is_teacher_acct = 't';
Question: Among all the donors from New York, how many of them are teachers?
SQL: SELECT count(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'
Database: donor
Note: from New Jersey refers to donor_state = 'NJ'; for an honoree refers to for_honoree = 't';
Question: How many donors from New Jersey have made a donation for an honoree?
SQL: SELECT count(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ'
Database: donor
Question: What is the donation message for donation ID a84dace1ff716f6f0c7af8ef9090a5d5?
SQL: SELECT donation_message FROM donations WHERE donationid = 'a84dace1ff716f6f0c7af8ef9090a5d5'
Database: donor
Note: Lakeshore Learning Materials is vendor_name; type of resources refers to project_resource_type;
Question: Please list the types of resources that the vendor Lakeshore Learning Materials has provided for the projects.
SQL: SELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Lakeshore Learning Materials'
Database: donor
Note: lakeshore Learning Materials is vendor_name; biggest amount refers to Max(item_quantity);
Question: What is the name of the item that is provided in the biggest amount by the vendor Lakeshore Learning Materials?
SQL: SELECT item_name FROM resources WHERE vendor_name = 'Lakeshore Learning Materials' ORDER BY item_quantity DESC LIMIT 1
Database: donor
Note: New York is the donor city; donor from the same city refers to donor from New York in which teacher_ny_teaching_fellow = 't';
Question: Among the projects created by a teacher from New York, how many of them have a donor from the same city?
SQL: SELECT count(projects.projectid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.teacher_ny_teaching_fellow = 't' AND donations.donor_city = 'New York'
Database: donor
Note: Lakeshore Learning Materials is vendor_name;  teacher with a doctor degree refers to teacher_prefix = 'Dr.';
Question: How many projects have their resources provided by the vendor Lakeshore Learning Materials and are created by a teacher with a doctor degree?
SQL: SELECT count(resources.projectid) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.vendor_name = 'Lakeshore Learning Materials' AND projects.teacher_prefix = 'Dr.'
Database: donor
Note: highest poverty level refers to poverty_level = 'highest poverty';
Question: Please list the vendor providing resources for the projects of a school with the highest poverty level.
SQL: SELECT resources.vendor_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.poverty_level = 'highest poverty'
Database: donor
Note: Lakeshore Learning Materials is vendor_name; highest cost of labor fulfillment refers to Max(fulfillment_labor_materials);
Question: Of the projects whose resources are provided by the vendor Lakeshore Learning Materials, the school of which project has the highest cost of labor fulfillment? Please give its school ID.
SQL: SELECT projects.schoolid FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.vendor_name = 'Lakeshore Learning Materials' ORDER BY projects.fulfillment_labor_materials DESC LIMIT 1
Database: donor
Note: Highest cost of the optional tip refers to Max(total_price_including_optional_support - total_price_excluding_optional_support);
Question: Who is the vendor of the resources needed by the project that had the highest cost of optional tip?
SQL: SELECT resources.vendor_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid ORDER BY projects.total_price_including_optional_support - projects.total_price_including_optional_support DESC LIMIT 1
Database: donor
Note: school in Brooklyn refers to school_city = 'Brooklyn'; total donated amount refers to donation_total;
Question: What is the total donated amount for projects created by a teacher working in a school in Brooklyn?
SQL: SELECT sum(donations.donation_total) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city = 'Brooklyn'
Database: donor
Note: school in Brooklyn refers to school_city = 'Brooklyn'; public magnet refers to school_magnet = 't';
Question: Please list the donation messages of the donations for the projects created by a teacher working in a public magnet school in Brooklyn.
SQL: SELECT donations.donation_message FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city = 'Brooklyn' AND projects.school_magnet = 't'
Database: donor
Note: portion using account credits redemption refers to payment_included_acct_credit = 't'; year-round school refers to school_year_round = 't';
Question: Among the donations with a portion using account credits redemption, how many of them are for projects created by teachers working in a public year-round school?
SQL: SELECT count(projects.projectid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE donations.payment_included_acct_credit = 't' AND projects.school_year_round = 't'
Database: donor
Note: main subject area refers to primary_focus_area = 'Literacy & Language'; total donation amount refers to Sum(dollar_amount);
Question: What is the total donation amount made for projects whose main subject area are Literacy & Language?
SQL: SELECT sum(donations.dollar_amount) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.primary_focus_area = 'Literacy & Language'
Database: donor
Note: main subject area refers to primary_focus_area = 'Literacy & Language'; donated the most refers to Max(donation_total);
Question: Which donor has donated the most for a project whose main subject area is Literacy & Language? Please give his or her ID.
SQL: SELECT donations.donor_acctid FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.primary_focus_area = 'Literacy & Language' ORDER BY donations.donation_total DESC LIMIT 1
Database: donor
Note: main subject area refers to primary_focus_area = 'Literacy & Language'; resource type supplies refers to project_resource_type = 'Supplies'; most requested item refers to Max(item_quantity);
Question: What is the most requested item under the resource type "Supplies" for projects whose main subject area is Literacy & Language?
SQL: SELECT resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.primary_focus_area = 'Literacy & Language' AND resources.project_resource_type = 'Supplies' ORDER BY resources.item_quantity DESC LIMIT 1
Database: donor
Note: main subject area refers to primary_focus_area = 'Literacy & Language'; highest unit price refers to Max(item_unit_price);
Question: Which item provided to a project whose main subject area is Literacy & Language has the highest unit price?
SQL: SELECT resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.primary_focus_area = 'Literacy & Language' ORDER BY resources.item_unit_price DESC LIMIT 1
Database: donor
Note: school in Brooklyn refers to school_city = 'Brooklyn'; Average = AVG(donation_total);
Question: What is the average donation amount to a project created by a teacher working in a school in Brooklyn?
SQL: SELECT sum(donations.donation_total) / count(donationid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city = 'Brooklyn'
Database: donor
Note: donor “22cbc920c9b5fa08dfb331422f5926b5” refers to donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'; city refers to donor_city;
Question: To which city did donor “22cbc920c9b5fa08dfb331422f5926b5” donate?
SQL: SELECT DISTINCT donor_city FROM donations WHERE donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'
Database: donor
Note: donor “22cbc920c9b5fa08dfb331422f5926b5” refers to donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'; is a teacher refers to is_teacher_acct;
Question: Is donor “22cbc920c9b5fa08dfb331422f5926b5” a teacher?
SQL: SELECT DISTINCT is_teacher_acct FROM donations WHERE donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'
Database: donor
Note: teacher "42d43fa6f37314365d08692e08680973" refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';
Question: Have the teacher "42d43fa6f37314365d08692e08680973" acquired P.h.D or doctor degree?
SQL: SELECT CASE WHEN teacher_prefix = 'Dr.' THEN 'Yes' ELSE 'NO' END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'
Database: donor
Note: teacher "42d43fa6f37314365d08692e08680973"refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';
Question: Is teacher "42d43fa6f37314365d08692e08680973" a New York teacher?
SQL: SELECT teacher_ny_teaching_fellow END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'
Database: donor
Note: Abington is school_city;
Question: Please list the titles of projects by which schools in Abington was donated.
SQL: SELECT essays.title FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE projects.school_city LIKE 'Abington'
Database: donor
Note: teacher "822b7b8768c17456fdce78b65abcc18e" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e';
Question: Please list the resource names of project that teacher "822b7b8768c17456fdce78b65abcc18e" created.
SQL: SELECT resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'
Database: donor
Note: donation didn't use account credits redemption refers to payment_included_acct_credit = 'f'; magnet school refers to school_magnet = 't';
Question: Among the schools' projects whose donation didn't use account credits redemption,how many schools are public magnet schools?
SQL: SELECT count(projects.schoolid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_magnet = 't' AND donations.payment_included_acct_credit = 'f'
Database: donor
Note: donation "b39547f29dfc25fb13c6e9e8d940dc43" refers to donationid = 'b39547f29dfc25fb13c6e9e8d940dc43'; type of resource refers to project_resource_type;
Question: Please provide the type of resource that donation "b39547f29dfc25fb13c6e9e8d940dc43" contain.
SQL: SELECT DISTINCT resources.project_resource_type FROM resources INNER JOIN projects ON resources.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE donations.donationid LIKE 'b39547f29dfc25fb13c6e9e8d940dc43'
Database: donor
Note: magnet school refers to school_magnet = 't'; donated resources as books refers to project_resource_type = 'Books'; percentage = Divide(Count(projectid) where project_resource_type = 'Books', Count(projectid))*100;
Question: Among public magnet schools,what percentage of schools that receive the donated resources as books?
SQL: SELECT cast(sum(CASE WHEN resources.project_resource_type = 'Books' THEN 1 ELSE 0 END) AS REAL) * 100 / count(resources.projectid) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_magnet = 't'
Database: donor
Note: ABC School Supply is vendor_name;  public magnet school refers to school_magnet = 't';
Question: In the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?
SQL: SELECT count(projects.schoolid) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_magnet = 't' AND resources.vendor_name = 'ABC School Supply'
Database: donor
Note: donor "000eebf28658900e63b538cf8a73afbd" refers to donor_acctid = '000eebf28658900e63b538cf8a73afbd'; highest poverty level refers to poverty_level = 'highest poverty';
Question: Among the schools donated by donor "000eebf28658900e63b538cf8a73afbd",how many schools whose poverty level are highest?
SQL: SELECT count(projects.schoolid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.poverty_level = 'highest poverty' AND donations.donor_acctid = '000eebf28658900e63b538cf8a73afbd'
Database: donor
Note: school “301c9bf0a45d159d162b65a93fddd74e" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';
Question: What is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”?
SQL: SELECT essays.short_description FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE projects.schoolid = '301c9bf0a45d159d162b65a93fddd74e'
Database: donor
Note: iMath is the title; city refers to school_city;
Question: Which city does the school that project "iMath" donated to in?
SQL: SELECT projects.school_city FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'iMath'
Database: donor
Note: teacher "822b7b8768c17456fdce78b65abcc18e" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'; how to pay the donation refers to payment_method;
Question: How to pay the donation of the project that teacher "822b7b8768c17456fdce78b65abcc18e" created?
SQL: SELECT donations.payment_method FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'
Database: donor
Note: teacher "822b7b8768c17456fdce78b65abcc18e" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'; donated refers to donation_total;
Question: How much did the project that teacher "822b7b8768c17456fdce78b65abcc18e" created donate?
SQL: SELECT donations.donation_total FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'