id int64 0 9.43k | db_id stringclasses 69
values | schema stringclasses 69
values | question stringlengths 24 325 | output stringlengths 23 804 | evidence stringlengths 0 673 | filtered_schema listlengths 0 16 |
|---|---|---|---|---|---|---|
8,100 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Which ranking system is criteria "Total Shanghai" in? | SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Total Shanghai' | criteria "Total Shanghai" refers to criteria_name = 'Total Shanghai'; which ranking system refers to system_name | [
"ranking_criteria.criteria_name",
"ranking_criteria.ranking_system_id",
"ranking_system.id",
"ranking_system.system_name"
] |
8,101 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | How many female students were there in Pierre and Marie Curie University in 2015? | SELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T2.university_name = 'Pierre and Marie Curie University' | female students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100); in Pierre and Marie Curie University refers to university_name = 'Pierre and Marie Curie University'; in 2015 refers to year = 2015 | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,102 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What was the score for University of Florida in "N and S" in 2014? | SELECT T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'University of Florida' AND T2.year = 2014 AND T1.criteria_name = 'N and S' | University of Florida refers to university_name = 'University of Florida'; in 2014 refers to year = 2014; in "N and S" refers to criteria_name = 'N and S' | [
"ranking_criteria.criteria_name",
"ranking_criteria.id",
"university.id",
"university.university_name",
"university_ranking_year.ranking_criteria_id",
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,103 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the number of international students of University of Wisconsin-Madison in 2013. | SELECT CAST(T1.num_students * T1.pct_international_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2013 AND T2.university_name = 'University of Wisconsin-Madison' | international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); University of Wisconsin-Madison refers to university_name = 'University of Wisconsin-Madison'; in 2013 refers to year = 2013 | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_international_students",
"university_year.university_id",
"university_year.year"
] |
8,104 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Show the name of the university with the lowest number of students in 2015. | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students ASC LIMIT 1 | lowest number of students refers to MIN(num_students); in 2015 refers to year = 2015; name of university refers to university_name; | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.university_id",
"university_year.year"
] |
8,105 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | How many times more was the number of students of University of Ottawa than Joseph Fourier University in 2013? | SELECT CAST(SUM(CASE WHEN T2.university_name = 'University of Ottawa' THEN T1.num_students ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.university_name = 'Joseph Fourier University' THEN T1.num_students ELSE 0 END) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2013 | Joseph Fourier University refers to university_name = 'Joseph Fourier University'; University of Ottawa refers to university_name = 'University of Ottawa'; in 2013 refers to year = 2013; how many times more refers to DIVIDE(SUM(num_students where university_name = 'University of Ottawa'), SUM(num_students where univers... | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.university_id",
"university_year.year"
] |
8,106 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the average number of criterias among "Times Higher Education World University Ranking","Shanghai Ranking" and "Center for World University Rankings". | SELECT (SUM(CASE WHEN T1.system_name = 'Center for World University Rankings' THEN 1 ELSE 0 END) + SUM(CASE WHEN T1.system_name = 'Shanghai Ranking' THEN 1 ELSE 0 END) + SUM(CASE WHEN T1.system_name = 'Times Higher Education World University Ranking' THEN 1 ELSE 0 END)) / 3 FROM ranking_system AS T1 INNER JOIN ranking_... | average number of criterias refers to DIVIDE(SUM(id), 3); "Times Higher Education World University Ranking", "Shanghai Ranking" and "Center for World University Rankings" refers to system_name IN ('Times Higher Education World University Ranking', 'Shanghai Ranking', 'Center for World University Rankings'); | [
"ranking_criteria.ranking_system_id",
"ranking_system.id",
"ranking_system.system_name"
] |
8,107 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the average number of students of all universities in 2012. | SELECT AVG(num_students) FROM university_year WHERE year = 2012 | average number of students refers to avg(num_students); in 2012 refers to year = 2012 | [
"university_year.num_students",
"university_year.year"
] |
8,108 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What is the score of university ID 68 in 2015? | SELECT score FROM university_ranking_year WHERE year = 2015 AND university_id = 68 | in 2015 refers to year = 2015 | [
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,109 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Provide the country ID of Cyprus. | SELECT id FROM country WHERE country_name = 'Cyprus' | Cyprus refers to country_name = 'Cyprus'; | [
"country.country_name",
"country.id"
] |
8,110 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What is the ID of university with the largest percentage of international students? | SELECT university_id FROM university_year ORDER BY pct_international_students DESC LIMIT 1 | largest percentage of international students refers to MAX(pct_international_students); ID of university refers to university_id | [
"university_year.pct_international_students",
"university_year.university_id"
] |
8,111 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Provide the criteria name of the ranking criteria ID 13. | SELECT criteria_name FROM ranking_criteria WHERE id = 13 | [
"ranking_criteria.criteria_name",
"ranking_criteria.id"
] | |
8,112 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What is the average score of all universities in 2012? | SELECT AVG(score) FROM university_ranking_year WHERE year = 2012 | average score refers to avg(score); in 2012 refers to year = 2012 | [
"university_ranking_year.score",
"university_ranking_year.year"
] |
8,113 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | In years 2011 to 2013, what is the total number of female students in university ID 40? | SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year BETWEEN 2011 AND 2013 AND university_id = 40 | total number of female students refers to SUM(DIVIDE(MULTIPLY(pct_female_students, num_students), 100)); In years 2011 to 2013 refers to year BETWEEN 2011 AND 2013 | [
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,114 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the average score of university ID 79 between year 2013 to 2015. | SELECT AVG(score) FROM university_ranking_year WHERE year BETWEEN 2013 AND 2015 AND university_id = 79 | average score refers to avg(score); between year 2013 to 2015 refers to year BETWEEN 2013 AND 2015 | [
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,115 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Give the student staff ratio of university ID 35. | SELECT student_staff_ratio FROM university_year WHERE university_id = 35 | [
"university_year.student_staff_ratio",
"university_year.university_id"
] | |
8,116 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Provide the score of the most populated university in 2011. | SELECT T2.score FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1 | most populated university refers to MAX(num_students); in 2011 refers to year = 2011; | [
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_year.num_students",
"university_year.university_id",
"university_year.year"
] |
8,117 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Give the criteria name where Harvard University scored 100. | SELECT DISTINCT T3.criteria_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN ranking_criteria AS T3 ON T3.id = T2.ranking_criteria_id WHERE T1.university_name = 'Harvard University' AND T2.score = 100 | Harvard University refers to university_name = 'Harvard University'; scored 100 refers to score = 100 | [
"ranking_criteria.criteria_name",
"ranking_criteria.id",
"university.id",
"university.university_name",
"university_ranking_year.ranking_criteria_id",
"university_ranking_year.score",
"university_ranking_year.university_id"
] |
8,118 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Provide the university name and ID of the university found in Turkey. | SELECT T1.university_name, T1.id FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Turkey' | found in Turkey refers to country_name = 'Turkey'; | [
"country.country_name",
"country.id",
"university.country_id",
"university.id",
"university.university_name"
] |
8,119 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What is the total number of ranking criteria under the ranking system called Shanghai Ranking? | SELECT COUNT(*) FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Shanghai Ranking' | ranking system called Shanghai Ranking refers to system_name = 'Shanghai Ranking'; | [
"ranking_criteria.ranking_system_id",
"ranking_system.id",
"ranking_system.system_name"
] |
8,120 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Give the name and score of the university ID 124. | SELECT T2.university_name, T1.score FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.id = 124 | name of university refers to university_name; | [
"university.id",
"university.university_name",
"university_ranking_year.score",
"university_ranking_year.university_id"
] |
8,121 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | How many female students are there in University of Pennsylvania in 2011? | SELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'University of Pennsylvania' | in 2011 refers to year 2011; female students refers to DIVIDE(MULTIPLY(num_students, pct_female_students), 100); University of Pennsylvania refers to a university name; | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,122 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | List down all universities that scored below 50. | SELECT DISTINCT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.score < 50 | scored below 50 refers to score < 50; all universities refers to university_name; | [
"university.id",
"university.university_name",
"university_ranking_year.score",
"university_ranking_year.university_id"
] |
8,123 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | How many universities are located in Japan? | SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Japan' | located in Japan refers to country_name = 'Japan'; | [
"country.country_name",
"country.id",
"university.country_id"
] |
8,124 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Provide the name of the university with the highest number of male students. | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.num_students * T1.pct_female_students / 100 - T1.num_students DESC LIMIT 1 | highest number of female students refers to MAX(SUBTRACT(num_students, DIVIDE(MULTIPLY(num_students, pct_female_students), 100))); name of university refers to university_name | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id"
] |
8,125 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | List the countries of universities that scored 70 and below in 2016. | SELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.score < 70 AND T2.year = 2016 | scored 70 and below refers to score < 70; in 2016 refers to year = 2016 | [
"country.country_name",
"country.id",
"university.country_id",
"university.id",
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,126 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate number of male students in Emory University in 2011. | SELECT CAST((T1.num_students - (T1.num_students * T1.pct_female_students)) AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Emory University' AND T1.year = 2011 | in 2011 refers to year 2011; number of male students refers to SUBTRACT(num_students, DIVIDE(MULTIPLY(num_students, pct_male_students), 100)); in Emory University refers to university_name = 'Emory University' | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,127 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | In which country does Johns Hopkins University located? | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Johns Hopkins University' | Johns Hopkins University refers to university_name = 'Johns Hopkins University'; which country refers to country_name | [
"country.country_name",
"country.id",
"university.country_id",
"university.university_name"
] |
8,128 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Give the names of universities with number of students ranges from 400 to 1000. | SELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students BETWEEN 400 AND 1000 | number of students ranges from 400 to 1000 refers to num_students BETWEEN 400 AND 1000; name of university refers to university_name | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.university_id"
] |
8,129 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | In what year does the Brown University score the highest? | SELECT T1.year FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' ORDER BY T1.score DESC LIMIT 1 | Brown University refers to university_name = 'Brown University'; score the highest refers to MAX(score) | [
"university.id",
"university.university_name",
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,130 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the average score of Emory University from 2011 to 2016. | SELECT AVG(T1.score) FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Emory University' AND T1.year BETWEEN 2011 AND 2016 | average score refers to avg(score); Emory University refers to university_name = 'Emory University'; from 2011 to 2016 refers to year BETWEEN 2011 AND 2016; | [
"university.id",
"university.university_name",
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,131 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Give the name of the university with the most number of students in 2015. | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students DESC LIMIT 1 | most number of students refers to MAX(num_students); in 2015 refers to year = 2015; name of university refers to university_name; | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.university_id",
"university_year.year"
] |
8,132 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | What is the location and number of female students in university ID 23 in 2011? | SELECT T3.country_name, CAST(T2.num_students * T2.pct_female_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2011 AND T1.id = 23 | in 2011 refers to year 2011; female students refers to DIVIDE(MULTIPLY(num_students, pct_female_students), 100); location refers to country_name | [
"country.country_name",
"country.id",
"university.country_id",
"university.id",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,133 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | How many universities scored 40 in teaching criteria? | SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.score = 40 AND T1.criteria_name = 'Teaching' AND T2.score = 40 | scored 40 refers to score = 40; in teaching refers to criteria_name = 'Teaching' | [
"ranking_criteria.criteria_name",
"ranking_criteria.id",
"university_ranking_year.ranking_criteria_id",
"university_ranking_year.score"
] |
8,134 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Among the universities in United States of America, what is the percentage of female students in year 2016? | SELECT SUM(CAST(T2.pct_female_students * T2.num_students AS REAL) / 100) * 100 / SUM(T2.num_students) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'United States of America' AND T2.year = 2016 | female students refers to DIVIDE(MULTIPLY(num_students, pct_female_students), 100); in United States of America refers to country_name = 'United States of America'; percentage refers to DIVIDE(SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100)), SUM(num_students)) | [
"country.country_name",
"country.id",
"university.country_id",
"university.id",
"university_year.num_students",
"university_year.pct_female_students",
"university_year.university_id",
"university_year.year"
] |
8,135 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | Calculate the difference between the total number of students and the number of international international students in Univeristy of Tokyo from 2011 to 2014. | SELECT SUM(T1.num_students) - SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year BETWEEN 2011 AND 2014 AND T2.university_name = 'University of Tokyo' | international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); difference refers to SUBTRACT(SUM(num_students), SUM(DIVIDE(MULTIPLY(num_students, pct_international_students), 100))); in University of Tokyo refers to university_name = 'University of Tokyo'; from 2011 to 2014 refers to ... | [
"university.id",
"university.university_name",
"university_year.num_students",
"university_year.pct_international_students",
"university_year.university_id",
"university_year.year"
] |
8,136 | university | CREATE TABLE country
(
id INTEGER not null
primary key,
country_name TEXT default NULL
);
CREATE TABLE ranking_system
(
id INTEGER not null
primary key,
system_name TEXT default NULL
);
CREATE TABLE ranking_criteria
(
id INTEGER not null
... | List the names of universities with a score less than 28% of the average score of all universities in 2015. | SELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T1.score * 100 < ( SELECT AVG(score) * 28 FROM university_ranking_year WHERE year = 2015 ) | in 2015 refers to year = 2015; score less than 28% refers to score < MULTIPLY(avg(score), 0.28) where year = 2015; names of universities refers to university_name | [
"university.id",
"university.university_name",
"university_ranking_year.score",
"university_ranking_year.university_id",
"university_ranking_year.year"
] |
8,137 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.9 were sold in store no.1 on 2012/1/1? | SELECT units FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 AND item_nbr = 9 | store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; on 2012/1/1 refers to date = '2012-01-01' | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,138 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.9 were sold in store no.1 in total in January, 2012? | SELECT SUM(units) FROM sales_in_weather WHERE SUBSTR(`date`, 6, 2) = '01' AND SUBSTR(`date`, 1, 4) = '2012' AND item_nbr = 9 AND store_nbr = 1 | store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; in January refers to SUBSTR(date, 1, 4) = '2012' and SUBSTR(date, 6, 2) = '01' | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,139 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the ID of the item that sold the best on 2012/1/1 in store no.1? | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1 | sold on 2012/1/1 refers to date = '2012-01-01'; in store no.1 refers to store_nbr = 1; item sold the best refers to Max(units) | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,140 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What was the temperature range of station no.1 on 2012/1/1? | SELECT tmax - tmin AS temrange FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-01' | on 2012/1/1 refers to date = '2012-01-01'; temperature range refers to Subtract (tmax, tmin); station no.1 refers to station_nbr = 1 | [
"weather.date",
"weather.station_nbr",
"weather.tmax",
"weather.tmin"
] |
8,141 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Please list the dates on which the temperature of station no.2 was above the 30-year normal. | SELECT `date` FROM weather WHERE station_nbr = 2 AND depart > 0 | temperature above the 30-year normal refers to depart > 0; station no.2 refers to station_nbr = 2 | [
"weather.date",
"weather.depart",
"weather.station_nbr"
] |
8,142 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | On which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2? | SELECT CASE WHEN (SUM(CASE WHEN `date` = '2012-01-01' THEN avgspeed ELSE 0 END) - SUM(CASE WHEN `date` = '2012-01-02' THEN avgspeed ELSE 0 END)) > 0 THEN '2012-01-01' ELSE '2012-01-02' END FROM weather WHERE station_nbr = 1 | station no.1 refers to station_nbr = 1; 2012/1/1 refers to date = '2012-01-01'; 2012/1/2 refers to date = '2012-01-02'; more windy refers to Max(avgspeed) | [
"weather.avgspeed",
"weather.date",
"weather.station_nbr"
] |
8,143 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the total number of units of item no.5 sold in store no.3 in 2012 on days when the temperature was below the 30-year normal? | SELECT SUM(CASE WHEN T3.depart < 0 THEN units ELSE 0 END) AS sum FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 | item no.5 refers to item_nbr = 5; store no. 3 refers to store_nbr = 3; when the temperature was below the 30-year normal refers to depart < 0; in 2012 refers to SUBSTR(date, 1, 4) = '2012'; total number of units refers to Sum(units) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.depart",
"weather.station_nbr"
] |
8,144 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.5 were sold in store no.3 on the day in 2012 when the max temperature was the highest? | SELECT T1.units FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 ORDER BY tmax DESC LIMIT 1 | item no.5 refers to item_nbr = 5; store no. 3 refers to store_nbr = 3; when the max temperature was highest refers to Max(tmax); in 2012 refers to SUBSTR(date, 1, 4) = '2012' | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.station_nbr"
] |
8,145 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012? | SELECT dewpoint FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 ORDER BY units DESC LIMIT 1 | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; in 2012 refers to SUBSTR(date, 1, 4) = '2012': most units sold refers to Max(units) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.station_nbr"
] |
8,146 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | On how many days with the max temperature over 90 did the sale of item no.5 in store no.3 exceed 100? | SELECT SUM(CASE WHEN units > 100 THEN 1 ELSE 0 END) AS count FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 AND tmax > 90 | max temperature over 90 refers to tmax > 90; item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; sale exceed 100 refers to units > 100; number of days refers to count (date) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.station_nbr"
] |
8,147 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.5 were sold in store no.3 on the day the temperature range was the biggest? | SELECT t2.units FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T2.item_nbr = 5 ORDER BY t3.tmax - t3.tmin DESC LIMIT 1 | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; when the temperature range was the biggest refers to Max(Subtract(tmax, tmin)) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"t2.units",
"t3.tmax",
"t3.tmin",
"weather.station_nbr"
] |
8,148 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Among the days on which over 100 units of item no.5 were sold in store no.3, on which date was the temperature range the biggest? | SELECT T2.`date` FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T2.item_nbr = 5 AND T2.units > 100 ORDER BY tmax - tmin DESC LIMIT 1 | over 100 units refers to units > 100; item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; the temperature range was the biggest refers to Max(Subtract(tmax, tmin)) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.station_nbr"
] |
8,149 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.5 were sold in store no.3 in total on days with a total precipitation of over 0.05? | SELECT SUM(CASE WHEN T3.preciptotal > 0.05 THEN units ELSE 0 END) AS sum FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.item_nbr = 5 | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; with a total precipitation of over 0.05 refers to preciptotal > 0.05 | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.preciptotal",
"weather.station_nbr"
] |
8,150 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Please list the dates on which the sale of item no.5 in store no.3 exceeded 100 and the average wind speed exceeded 10. | SELECT T1.`date` FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.item_nbr = 5 AND T1.units > 100 AND T3.avgspeed > 10 | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; exceed 100 refers to units > 100; average wind speed exceeded 10 refers to avgspeed > 10 | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.avgspeed",
"weather.station_nbr"
] |
8,151 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the total units of products sold on the day with the highest max temperature in store no.3 in 2012? | SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.`date` LIKE '%2012%' GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1 | highest max temperature refers to Max(tmax); store no.3 refers to store_nbr = 3; in 2012 refers to substring (date, 1, 4) = '2012'; total units refers to sum(units) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.store_nbr",
"weather.station_nbr",
"weather.tmax"
] |
8,152 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10? | SELECT ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) FROM sal... | store no. 5 refers to store_nbr = 5; store no. 10 refers to store_nbr = 10; item no.16 refers to item_nbr = 16; in 2012 refers to SUBSTR(date, 1, 4) = '2012'; highest max temperature refers to Max(tmax); more units sold refers to Subtract ( Sum(units where store_nbr = 5), Sum(units where store_nbr = 10)) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.station_nbr",
"weather.tmax"
] |
8,153 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the ID of the item that sold the best on the day with the highest max temperature in store no.3 in 2012? | SELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND tmax = ( SELECT MAX(tmax) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.... | highest max temperature refers to Max(tmax); store no.3 refers to store_nbr = 3; in 2012 refers to substring (date, 1, 4) = '2012'; sold the best refers to Max(units); ID of the item refers to item_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.station_nbr"
] |
8,154 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | On the day with the highest max temperature in 2012, how many items in store no.3 had no sales? | SELECT COUNT(DISTINCT T1.item_nbr) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr AND T1.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.units = 0 GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1 | highest max temperature refers to Max(tmax); in 2012 refers to SUBSTR(date, 1, 4) = '2012'; store no.3 refers to store_nbr = 3; had no sale refers to units = 0 | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.station_nbr",
"weather.tmax"
] |
8,155 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90? | SELECT CAST(SUM(T1.units) AS REAL) / COUNT(T1.`date`) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.item_nbr = 5 AND T3.tmax > 90 | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; when the maximum temperature exceed 90 refers to tmax > 90; average = Divide (Sum(units), Count(date)) | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.station_nbr",
"weather.tmax"
] |
8,156 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the percentage of the units of item no.5 sold among all units of items sold in store no.3 on the day with the highest max temperature in 2012? | SELECT CAST(SUM(CASE WHEN T1.item_nbr = 5 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND T3.tmax = ( SELECT MAX(... | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; highest max temperature refers to Max(tmax); in 2012 refers to SUBSTR(date, 1, 4) = '2012'; Percentage = Divide (Sum(units where item_nbr = 5), Sum(units)) * 100 | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.station_nbr",
"weather.tmax"
] |
8,157 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Give the id of the bestsellers of store no.1 on 2012/1/1. | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1 | store no. 1 refers to store_nbr = 1; on 2012/1/1 refers to date = '2012-01-01'; best seller refers to Max(units); ID refers to item_nbr | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,158 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many no.9 items from store no.11 were sold on 2012/12/7? | SELECT units FROM sales_in_weather WHERE `date` = '2012-12-07' AND store_nbr = 11 AND item_nbr = 9 | no. 9 item refers to item_nbr = 9; store no.11 refers to store_nbr = 11; sold on 2012/12/7 refers to date = '2012-12-07' | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,159 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Give the average temperature of station no.20 on 2014/10/17. | SELECT tavg FROM weather WHERE `date` = '2014-10-17' AND station_nbr = 20 | station no.20 refers to station_nbr = 20; on 2014/10/17 refers to date = '2014-10-17'; average temperature refers to tavg | [
"weather.date",
"weather.station_nbr",
"weather.tavg"
] |
8,160 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Tell the resultant wind speed of station no.9 on 2014/1/15. | SELECT resultspeed FROM weather WHERE `date` = '2014-01-15' AND station_nbr = 9 | station no.9 refers to station_nbr = 9; on 2014/1/15 refers to date = '2014/01/15'; result wind speed refers to resultspeed | [
"weather.date",
"weather.resultspeed",
"weather.station_nbr"
] |
8,161 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Give the id of the weather station with most stores. | SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(station_nbr) DESC LIMIT 1 | station with more stores refers to Max(Count(store_nbr)); ID of weather station refers to station_nbr | [
"relation.station_nbr"
] |
8,162 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Which weather station does store no.20 belong to? | SELECT station_nbr FROM relation WHERE store_nbr = 20 | store no.20 refers to store_nbr = 20; weather station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr"
] |
8,163 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Tell the temperature range of the home weather station of store no.7 on 2014/4/28. | SELECT T1.tmax - T1.tmin AS temprange FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 7 AND T1.`date` = '2014-04-28' | store no.7 refers to tore_nbr = 7; on 2014/4/28 refers to date = '2014-04-28'; temperature range refers to Subtract (tmax, tmin) | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr",
"weather.tmax",
"weather.tmin"
] |
8,164 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | For the weather station which recorded the highest temperature above the 30-year normal, how many stores does it have? | SELECT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY depart DESC LIMIT 1 ) | highest temperature above the 30-year normal refers to Max(depart) | [
"weather.depart",
"weather.station_nbr"
] |
8,165 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | For the home weather station of store no.15, what was the dew point on 2012/2/18? | SELECT T1.dewpoint FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 15 AND T1.`date` = '2012-02-18' | store no. 15 refers to store_nbr = 15; on 2012/2/18 refers to date = '2012-02-18' | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.dewpoint",
"weather.station_nbr"
] |
8,166 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Tell the wet-bulb temperature of the weather station which contained store no.6 on 2012/2/15. | SELECT T1.wetbulb FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 14 AND T1.`date` = '2012-02-15' | store no.6 refers to store_nbr = 6; on 2012/2/15 refers to date = '2012-02-15'; wet-bulb temperature refers to wetbulb | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr",
"weather.wetbulb"
] |
8,167 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Give the number of stores which opened on the weather station that recorded the fastest average wind speed. | SELECT COUNT(T.store_nbr) FROM ( SELECT DISTINCT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 ) ) T | fastest average wind speed refers to Max(avgspeed); number of store refers to count(store_nbr) | [
"T.store_nbr",
"weather.avgspeed",
"weather.station_nbr"
] |
8,168 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | State the max temperature of the weather station which has the no.21 store on 2012/11/9. | SELECT tmax FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 21 AND T1.`date` = '2012-11-09' | no.21 store refers to store_nbr = 21; on 2012/11/9 refers to date = '2012-11-09'; max temperature refers to tmax | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr"
] |
8,169 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Provide the sunrise time recorded by the home weather station of store no.30 on 2014/2/21. | SELECT T1.sunrise FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2014-02-21' AND store_nbr = 30 | store no. 30 refers to store_nbr = 30; on 2014/2/21 refers to date = '2014-02-21' | [
"relation.station_nbr",
"weather.date",
"weather.station_nbr",
"weather.sunrise"
] |
8,170 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | State the number of stores that belongs to the weather station which recorded the deepest snowfall. | SELECT T2.store_nbr FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr ORDER BY snowfall DESC LIMIT 1 | deepest snowfall refers to Max(snowfall); number of stores refers to store_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"weather.station_nbr"
] |
8,171 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Provide the code summarization for the weather recorded by the weather station which contained the no.2 store on 2013/2/12. | SELECT T1.codesum FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-12' AND T2.store_nbr = 2 | no.2 store refers to store_nbr = 2; on 2013/2/12 refers to date = '2013-02-12'; code summarization refers to codesum | [
"relation.station_nbr",
"relation.store_nbr",
"weather.codesum",
"weather.date",
"weather.station_nbr"
] |
8,172 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Show the sea level status recorded by the weather station of store no.19 on 2013/2/24. | SELECT T1.sealevel FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-24' AND T2.store_nbr = 19 | store no.19 refers to store_nbr = 19; on 2013/2/24 refers to date = '2013-02-24'; sea level status refers to sealevel | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.sealevel",
"weather.station_nbr"
] |
8,173 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many inches of total precipitation was recorded by the weather station of store no.2 on 2012/12/25? | SELECT T1.preciptotal FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-12-25' AND T2.store_nbr = 2 | store no.2 refers to store_nbr = 2; on 2012/12/25 refers to date = '2012-12-25'; total precipitation refers to preciptotal | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.preciptotal",
"weather.station_nbr"
] |
8,174 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Give the station pressure status recorded by the weather station which contained no.12 store on 2012/5/15. | SELECT T1.stnpressure FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-05-15' AND T2.store_nbr = 12 | no.12 store refers to store_nbr = 12; on 2012/5/15 refers to date = '2012-05-15'; station pressure status refers to stnpressure | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr",
"weather.stnpressure"
] |
8,175 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31? | SELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.`date` = '2014-10-31' | store no.10 refers to store_nbr = 10; on 2014/10/31 refers to date = '2014-10-31'; percentage = Divide (Sum(units where store_nbr = 10), Sum(units)) * 100 | [
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.store_nbr"
] |
8,176 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | For the weather station has store no.9, what was the increased percentage of the average temperature from 2012/2/2 to 2012/2/3? | SELECT CAST((SUM(CASE WHEN T1.`date` = '2012-02-03' THEN T1.tavg * 1 ELSE 0 END) - SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHE... | store no.9 refers to store_nbr = 9; 2012/2/2 refers to date = '2012-02-02'; 2012/2/3 refers to date = '2012-02-03'; average temperature refers to tavg; increase percentage = Divide (Subtract (tavg where date = '2012-02-03', tavg where date = '2012-02-02'), tavg where date = '2012-02-02') * 100 | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr",
"weather.tavg"
] |
8,177 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012? | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1 | item number refers to item_nbr; highest number of units sold refers to Max(units); store no.1 refers to store_nbr = 1; on 1/1/2012 refers to date = '2012-01-01' | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,178 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many stores are in weather station 12? | SELECT SUM(store_nbr) FROM relation WHERE station_nbr = 12 | weather station 12 refers to station_nbr = 12; number of stores refers to Count(store_nbr) | [
"relation.station_nbr",
"relation.store_nbr"
] |
8,179 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many items weren't sold in store 2 on 1/1/2012? | SELECT COUNT(item_nbr) FROM sales_in_weather WHERE store_nbr = 2 AND units = 0 AND `date` = '2012-01-01' | store no.2 refers to store_nbr = 2; item weren't sold refers to units = 0; on 1/1/2012 refers to date = '2012-01-01' | [
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,180 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Between 1/1/2012 to 12/31/2014, which date recorded the hottest temperature in weather station 1? | SELECT `date` FROM weather WHERE station_nbr = 1 AND CAST(SUBSTR(`date`, 1, 4) AS int) BETWEEN 2012 AND 2014 ORDER BY tmax DESC LIMIT 1 | weather station 1 refers to station_nbr = 1; hottest temperature refers to Max(tmax); between 1/1/2012 to 12/31/2014 refers to SUBSTR(date, 1, 4) between 2012 and 2014 | [
"weather.date",
"weather.station_nbr",
"weather.tmax"
] |
8,181 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Which weather station has the highest number of stores? | SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1 | number of store refers to store_nbr; highest number of store refers to Max(Count(store_nbr)); weather station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr"
] |
8,182 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | In March 2014, which weather stations recorded the highest number of days whose temperature is below the 30-year normal? | SELECT station_nbr FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr HAVING COUNT(DISTINCT `date`) = ( SELECT COUNT(DISTINCT `date`) FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr ORD... | in March 2014 refers to substring (date, 1, 4) = '2014' and substring (date, 6, 2) = '03'; temperature is below the 30-year normal refers to depart < 0; highest number of days refers to Max(Count(date)) | [
"weather.date",
"weather.depart",
"weather.station_nbr"
] |
8,183 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Which weather station does the store that sold the highest quantity of item 9 belongs to? | SELECT station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 9 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | item 9 refers to item_nbr = 9; sold the highest quantity refers to Max(Sum(units)); weather station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,184 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many stores belong to the most windy station? | SELECT COUNT(store_nbr) FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 ) | most windy station refers to Max(avgspeed) | [
"weather.avgspeed",
"weather.station_nbr"
] |
8,185 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Among the stores in weather station 14 in February 2014, which store had sold no less than 300 quantities for item number 44 in a single day? | SELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.station_nbr = 14 AND T1.`date` LIKE '%2014-02%' AND T1.item_nbr = 44 AND units >= 300 | weather station 14 refers to station_nbr = 14; February 2014 refers to substring (date, 1, 7) = '2014-02' ; sold no less than 300 quantities refers to units > = 300; item no.44 refers to item_nbr = 44; store refers to store_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr"
] |
8,186 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the most purchased products during the rainy days in June 2013 in weather station 9? | SELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T3.station_nbr = 9 AND T1.`date` LIKE '%2013-06%' AND codesum = 'RA' ORDER BY T1.units DESC LIMIT 1 | most purchased product refers to Max(units); during the rainy day refers to codesum = RA; in June 2013 refers to SUBSTR(date, 1, 7) = '2013-06'; weather station 9 refers to station_nbr = 9; product refers to item_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units",
"weather.station_nbr"
] |
8,187 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Which station sold the highest quantity of item number 5 overall? | SELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 5 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | item number 5 refers to item_nbr = 5; sold highest quantity refers to Max(Sum(units)); station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,188 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the earliest sunrise recorded in the stations with no more than 1 store in February 2012? | SELECT T1.station_nbr FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE sunrise IS NOT NULL AND T2.`date` LIKE '%2012-02%' AND T1.station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 1 ) ORDER BY sunrise LIMIT 1 | in February 2012 refers to SUBSTR(date, 1, 7) = '2012-02'; earliest sunrise Min(sunrise); station with no more than 1 store refers to station_nbr where Count(store_nbr) = 1 | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr"
] |
8,189 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | In weather station 17, which store sold the highest quantity of item 45 in October 2012? | SELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 45 AND T2.station_nbr = 17 AND T1.`date` LIKE '%2012-10%' GROUP BY T1.store_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | weather station 17 refers to station_nbr = 17; item 45 refers to item_nbr = 45; in October 2012 refers to SUBSTR(date, 1, 7) = '2012-10': highest quantity refers to Max(Sum(units)); store refers to store_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,190 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What are the items sold by the store during the day whose station recorded the thickest snowfall? | SELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN ( SELECT station_nbr, `date` FROM weather ORDER BY snowfall DESC LIMIT 1 ) AS T3 ON T2.station_nbr = T3.station_nbr | thickest snowfall refers to Max(snowfall); item refers to item_nbr | [
"T3.station_nbr",
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.item_nbr",
"sales_in_weather.store_nbr",
"weather.date",
"weather.snowfall",
"weather.station_nbr"
] |
8,191 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What are the top 3 stations that have sold the highest quantities for an item in a single day? | SELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr ORDER BY T1.units DESC LIMIT 3 | highest quantity refers to Max(units); station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"sales_in_weather.store_nbr",
"sales_in_weather.units"
] |
8,192 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many stores belong to the station with the highest recorded heat of all time? | SELECT COUNT(T2.store_nbr) FROM ( SELECT station_nbr FROM weather ORDER BY heat DESC LIMIT 1 ) AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr | highest recorded heat refers to Max(heat); station refers to station_nbr | [
"T1.station_nbr",
"relation.station_nbr",
"relation.store_nbr",
"weather.heat",
"weather.station_nbr"
] |
8,193 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | On February 8, 2014, what is the minimum temperature in the station where store 29 belongs? | SELECT tmin FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.store_nbr = 29 AND T2.`date` = '2014-02-08' | On February 8, 2014 refers to date = '2014-02-08'; store 29 refers to store_nbr = 29; minimum temperature refers to tmin; station refers to station_nbr | [
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr"
] |
8,194 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Among the stations with 3 stores, how many stations have a station pressure of no more than 30 on February 18, 2014? | SELECT COUNT(station_nbr) FROM weather WHERE `date` = '2014-02-18' AND stnpressure < 30 AND station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 3 ) | station with 3 stores refers to station_nbr where Count(store_nbr) = 3; station pressure of no more than 30 refers to stnpressure < 30; On February 18, 2014 refers to date = '2014-02-18' | [
"relation.station_nbr",
"relation.store_nbr"
] |
8,195 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Which station has the highest number of stores? Calculate the said station's average maximum temperature in February 2012. | SELECT CAST(SUM(T2.tmax) AS REAL) / 29 FROM ( SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1 ) AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE SUBSTR(T2.`date`, 1, 7) = '2012-02' | station with highest number of stores refers to station_nbr where Max(Count(store_nbr)); station refers to station_nbr; in February 2012 refers to substring (date, 1, 7) = '2012-02'; average maximum temperature = Divide(Sum(tmax), 29) | [
"T1.station_nbr",
"relation.station_nbr",
"relation.store_nbr",
"weather.date",
"weather.station_nbr",
"weather.tmax"
] |
8,196 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | Between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014? | SELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE station_nbr = 12 AND item_nbr = 5 AND T2.`date` LIKE '%2014%' | weather station 12 refers to station_nbr = 12; item 5 refers to item_nbr = 5; 10 store refers to store_nbr = 10; in 2014 refers to SUBSTR(date, 1, 4) = '2014'; percentage = Divide (Sum(units where store_nbr = 10), Sum(units)) * 100 | [
"relation.store_nbr",
"sales_in_weather.date",
"sales_in_weather.store_nbr"
] |
8,197 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | What is the maximum average speed? | SELECT MAX(avgspeed) FROM weather | maximum average speed refers to Max(avgspeed) | [
"weather.avgspeed"
] |
8,198 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many days did the show fell more than 5 inches? | SELECT COUNT(DISTINCT `date`) FROM weather WHERE snowfall > 5 | snow fell more than 5 inches refers to snowfall > 5 | [
"weather.date",
"weather.snowfall"
] |
8,199 | sales_in_weather | CREATE TABLE sales_in_weather
(
date DATE,
store_nbr INTEGER,
item_nbr INTEGER,
units INTEGER,
primary key (store_nbr, date, item_nbr)
);
CREATE TABLE weather
(
station_nbr INTEGER,
date DATE,
tmax INTEGER,
tmin INTEGER,
tavg INTEGER,
de... | How many days did the sun rise before 5 AM? | SELECT COUNT(DISTINCT `date`) AS days FROM weather WHERE sunrise < time('05:00:00') | sunrise before 5 Am refers to sunrise < time ('5:00:00') | [
"weather.date",
"weather.sunrise"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.