db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
university
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'
Question: which ranking system is criteria 'total shanghai' in? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. u...
which ranking system is criteria 'total shanghai' in?
university
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'
Question: how many female students were there in pierre and marie curie university in 2015? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking...
how many female students were there in pierre and marie curie university in 2015?
university
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'
Question: what was the score for university of florida in 'n and s' in 2014? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, y...
what was the score for university of florida in 'n and s' in 2014?
university
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'
Question: calculate the number of international students of university of wisconsin-madison in 2013. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id...
calculate the number of international students of university of wisconsin-madison in 2013.
university
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
Question: show the name of the university with the lowest number of students in 2015. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_crite...
show the name of the university with the lowest number of students in 2015.
university
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
Question: how many times more was the number of students of university of ottawa than joseph fourier university in 2013? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_y...
how many times more was the number of students of university of ottawa than joseph fourier university in 2013?
university
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_...
Question: calculate the average number of criterias among 'times higher education world university ranking','shanghai ranking' and 'center for world university rankings'. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id,...
calculate the average number of criterias among 'times higher education world university ranking','shanghai ranking' and 'center for world university rankings'.
university
select avg(num_students) from university_year where year = 2012
Question: calculate the average number of students of all universities in 2012. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id...
calculate the average number of students of all universities in 2012.
university
select score from university_ranking_year where year = 2015 and university_id = 68
Question: what is the score of university id 68 in 2015? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. universi...
what is the score of university id 68 in 2015?
university
select id from country where country_name = 'cyprus'
Question: provide the country id of cyprus. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. university_year -> un...
provide the country id of cyprus.
university
select university_id from university_year order by pct_international_students desc limit 1
Question: what is the id of university with the largest percentage of international students? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranki...
what is the id of university with the largest percentage of international students?
university
select criteria_name from ranking_criteria where id = 13
Question: provide the criteria name of the ranking criteria id 13. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score...
provide the criteria name of the ranking criteria id 13.
university
select avg(score) from university_ranking_year where year = 2012
Question: what is the average score of all universities in 2012? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. ...
what is the average score of all universities in 2012?
university
select sum(cast(num_students * pct_female_students as real) / 100) from university_year where year between 2011 and 2013 and university_id = 40
Question: in years 2011 to 2013, what is the total number of female students in university id 40? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, r...
in years 2011 to 2013, what is the total number of female students in university id 40?
university
select avg(score) from university_ranking_year where year between 2013 and 2015 and university_id = 79
Question: calculate the average score of university id 79 between year 2013 to 2015. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criter...
calculate the average score of university id 79 between year 2013 to 2015.
university
select student_staff_ratio from university_year where university_id = 35
Question: give the student staff ratio of university id 35. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. unive...
give the student staff ratio of university id 35.
university
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
Question: provide the score of the most populated university in 2011. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, sc...
provide the score of the most populated university in 2011.
university
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
Question: give the criteria name where harvard university scored 100. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, sc...
give the criteria name where harvard university scored 100.
university
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'
Question: provide the university name and id of the university found in turkey. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id...
provide the university name and id of the university found in turkey.
university
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'
Question: what is the total number of ranking criteria under the ranking system called shanghai ranking? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> universit...
what is the total number of ranking criteria under the ranking system called shanghai ranking?
university
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
Question: give the name and score of the university id 124. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. unive...
give the name and score of the university id 124.
university
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'
Question: how many female students are there in university of pennsylvania in 2011? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteri...
how many female students are there in university of pennsylvania in 2011?
university
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
Question: list down all universities that scored below 50. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. univer...
list down all universities that scored below 50.
university
select count(*) from university as t1 inner join country as t2 on t1.country_id = t2.id where t2.country_name = 'japan'
Question: how many universities are located in japan? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. university_...
how many universities are located in japan?
university
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
Question: provide the name of the university with the highest number of male students. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_crit...
provide the name of the university with the highest number of male students.
university
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
Question: list the countries of universities that scored 70 and below in 2016. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id,...
list the countries of universities that scored 70 and below in 2016.
university
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
Question: calculate number of male students in emory university in 2011. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year,...
calculate number of male students in emory university in 2011.
university
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'
Question: in which country does johns hopkins university located? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score....
in which country does johns hopkins university located?
university
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
Question: give the names of universities with number of students ranges from 400 to 1000. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_c...
give the names of universities with number of students ranges from 400 to 1000.
university
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
Question: in what year does the brown university score the highest? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, scor...
in what year does the brown university score the highest?
university
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
Question: calculate the average score of emory university from 2011 to 2016. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, y...
calculate the average score of emory university from 2011 to 2016.
university
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
Question: give the name of the university with the most number of students in 2015. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteri...
give the name of the university with the most number of students in 2015.
university
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
Question: what is the location and number of female students in university id 23 in 2011? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_c...
what is the location and number of female students in university id 23 in 2011?
university
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
Question: how many universities scored 40 in teaching criteria? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year -> university_id, ranking_criteria_id, year, score. u...
how many universities scored 40 in teaching criteria?
university
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
Question: among the universities in united states of america, what is the percentage of female students in year 2016? | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year...
among the universities in united states of america, what is the percentage of female students in year 2016?
university
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'
Question: calculate the difference between the total number of students and the number of international international students in univeristy of tokyo from 2011 to 2014. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, c...
calculate the difference between the total number of students and the number of international international students in univeristy of tokyo from 2011 to 2014.
university
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 )
Question: list the names of universities with a score less than 28% of the average score of all universities in 2015. | Tables: country -> id, country_name. ranking_system -> id, system_name. ranking_criteria -> id, ranking_system_id, criteria_name. university -> id, country_id, university_name. university_ranking_year...
list the names of universities with a score less than 28% of the average score of all universities in 2015.
sales_in_weather
select units from sales_in_weather where `date` = '2012-01-01' and store_nbr = 1 and item_nbr = 9
Question: how many units of item no.9 were sold in store no.1 on 2012/1/1? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir...
how many units of item no.9 were sold in store no.1 on 2012/1/1?
sales_in_weather
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
Question: how many units of item no.9 were sold in store no.1 in total in january, 2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultsp...
how many units of item no.9 were sold in store no.1 in total in january, 2012?
sales_in_weather
select item_nbr from sales_in_weather where `date` = '2012-01-01' and store_nbr = 1 order by units desc limit 1
Question: what is the id of the item that sold the best on 2012/1/1 in store no.1? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, r...
what is the id of the item that sold the best on 2012/1/1 in store no.1?
sales_in_weather
select tmax - tmin as temrange from weather where station_nbr = 1 and `date` = '2012-01-01'
Question: what was the temperature range of station no.1 on 2012/1/1? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avg...
what was the temperature range of station no.1 on 2012/1/1?
sales_in_weather
select `date` from weather where station_nbr = 2 and depart > 0
Question: please list the dates on which the temperature of station no.2 was above the 30-year normal. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, seal...
please list the dates on which the temperature of station no.2 was above the 30-year normal.
sales_in_weather
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
Question: on which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultsp...
on which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2?
sales_in_weather
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
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, ...
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?
sales_in_weather
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
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptota...
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?
sales_in_weather
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
Question: what was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, se...
what was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012?
sales_in_weather
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
Question: on how many days with the max temperature over 90 did the sale of item no.5 in store no.3 exceed 100? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpress...
on how many days with the max temperature over 90 did the sale of item no.5 in store no.3 exceed 100?
sales_in_weather
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
Question: how many units of item no.5 were sold in store no.3 on the day the temperature range was the biggest? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpress...
how many units of item no.5 were sold in store no.3 on the day the temperature range was the biggest?
sales_in_weather
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
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, sno...
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?
sales_in_weather
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
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, ...
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?
sales_in_weather
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
Question: 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. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, pre...
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.
sales_in_weather
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
Question: what is the total units of products sold on the day with the highest max temperature in store no.3 in 2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, st...
what is the total units of products sold on the day with the highest max temperature in store no.3 in 2012?
sales_in_weather
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...
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, sn...
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?
sales_in_weather
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....
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptota...
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?
sales_in_weather
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
Question: on the day with the highest max temperature in 2012, how many items in store no.3 had no sales? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, s...
on the day with the highest max temperature in 2012, how many items in store no.3 had no sales?
sales_in_weather
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
Question: how many units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptota...
how many units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90?
sales_in_weather
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(...
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise,...
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?
sales_in_weather
select item_nbr from sales_in_weather where `date` = '2012-01-01' and store_nbr = 1 order by units desc limit 1
Question: give the id of the bestsellers of store no.1 on 2012/1/1. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgsp...
give the id of the bestsellers of store no.1 on 2012/1/1.
sales_in_weather
select units from sales_in_weather where `date` = '2012-12-07' and store_nbr = 11 and item_nbr = 9
Question: how many no.9 items from store no.11 were sold on 2012/12/7? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, av...
how many no.9 items from store no.11 were sold on 2012/12/7?
sales_in_weather
select tavg from weather where `date` = '2014-10-17' and station_nbr = 20
Question: give the average temperature of station no.20 on 2014/10/17. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, av...
give the average temperature of station no.20 on 2014/10/17.
sales_in_weather
select resultspeed from weather where `date` = '2014-01-15' and station_nbr = 9
Question: tell the resultant wind speed of station no.9 on 2014/1/15. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avg...
tell the resultant wind speed of station no.9 on 2014/1/15.
sales_in_weather
select station_nbr from relation group by station_nbr order by count(station_nbr) desc limit 1
Question: give the id of the weather station with most stores. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. ...
give the id of the weather station with most stores.
sales_in_weather
select station_nbr from relation where store_nbr = 20
Question: which weather station does store no.20 belong to? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. rel...
which weather station does store no.20 belong to?
sales_in_weather
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'
Question: tell the temperature range of the home weather station of store no.7 on 2014/4/28. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resu...
tell the temperature range of the home weather station of store no.7 on 2014/4/28.
sales_in_weather
select store_nbr from relation where station_nbr = ( select station_nbr from weather order by depart desc limit 1 )
Question: for the weather station which recorded the highest temperature above the 30-year normal, how many stores does it have? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, prec...
for the weather station which recorded the highest temperature above the 30-year normal, how many stores does it have?
sales_in_weather
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'
Question: for the home weather station of store no.15, what was the dew point on 2012/2/18? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resul...
for the home weather station of store no.15, what was the dew point on 2012/2/18?
sales_in_weather
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'
Question: tell the wet-bulb temperature of the weather station which contained store no.6 on 2012/2/15. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sea...
tell the wet-bulb temperature of the weather station which contained store no.6 on 2012/2/15.
sales_in_weather
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
Question: give the number of stores which opened on the weather station that recorded the fastest average wind speed. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, st...
give the number of stores which opened on the weather station that recorded the fastest average wind speed.
sales_in_weather
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'
Question: state the max temperature of the weather station which has the no.21 store on 2012/11/9. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel...
state the max temperature of the weather station which has the no.21 store on 2012/11/9.
sales_in_weather
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
Question: provide the sunrise time recorded by the home weather station of store no.30 on 2014/2/21. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealev...
provide the sunrise time recorded by the home weather station of store no.30 on 2014/2/21.
sales_in_weather
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
Question: state the number of stores that belongs to the weather station which recorded the deepest snowfall. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressur...
state the number of stores that belongs to the weather station which recorded the deepest snowfall.
sales_in_weather
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
Question: provide the code summarization for the weather recorded by the weather station which contained the no.2 store on 2013/2/12. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall,...
provide the code summarization for the weather recorded by the weather station which contained the no.2 store on 2013/2/12.
sales_in_weather
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
Question: show the sea level status recorded by the weather station of store no.19 on 2013/2/24. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, ...
show the sea level status recorded by the weather station of store no.19 on 2013/2/24.
sales_in_weather
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
Question: how many inches of total precipitation was recorded by the weather station of store no.2 on 2012/12/25? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpre...
how many inches of total precipitation was recorded by the weather station of store no.2 on 2012/12/25?
sales_in_weather
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
Question: give the station pressure status recorded by the weather station which contained no.12 store on 2012/5/15. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stn...
give the station pressure status recorded by the weather station which contained no.12 store on 2012/5/15.
sales_in_weather
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'
Question: what percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptota...
what percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31?
sales_in_weather
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...
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowf...
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?
sales_in_weather
select item_nbr from sales_in_weather where `date` = '2012-01-01' and store_nbr = 1 order by units desc limit 1
Question: what is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, st...
what is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012?
sales_in_weather
select sum(store_nbr) from relation where station_nbr = 12
Question: how many stores are in weather station 12? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. relation -...
how many stores are in weather station 12?
sales_in_weather
select count(item_nbr) from sales_in_weather where store_nbr = 2 and units = 0 and `date` = '2012-01-01'
Question: how many items weren't sold in store 2 on 1/1/2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. r...
how many items weren't sold in store 2 on 1/1/2012?
sales_in_weather
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
Question: between 1/1/2012 to 12/31/2014, which date recorded the hottest temperature in weather station 1? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure,...
between 1/1/2012 to 12/31/2014, which date recorded the hottest temperature in weather station 1?
sales_in_weather
select station_nbr from relation group by station_nbr order by count(store_nbr) desc limit 1
Question: which weather station has the highest number of stores? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspee...
which weather station has the highest number of stores?
sales_in_weather
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...
Question: in march 2014, which weather stations recorded the highest number of days whose temperature is below the 30-year normal? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, pr...
in march 2014, which weather stations recorded the highest number of days whose temperature is below the 30-year normal?
sales_in_weather
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
Question: which weather station does the store that sold the highest quantity of item 9 belongs to? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealeve...
which weather station does the store that sold the highest quantity of item 9 belongs to?
sales_in_weather
select count(store_nbr) from relation where station_nbr = ( select station_nbr from weather order by avgspeed desc limit 1 )
Question: how many stores belong to the most windy station? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. rel...
how many stores belong to the most windy station?
sales_in_weather
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
Question: 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? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, ...
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?
sales_in_weather
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
Question: what is the most purchased products during the rainy days in june 2013 in weather station 9? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, seal...
what is the most purchased products during the rainy days in june 2013 in weather station 9?
sales_in_weather
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
Question: which station sold the highest quantity of item number 5 overall? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdi...
which station sold the highest quantity of item number 5 overall?
sales_in_weather
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
Question: what is the earliest sunrise recorded in the stations with no more than 1 store in february 2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure,...
what is the earliest sunrise recorded in the stations with no more than 1 store in february 2012?
sales_in_weather
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
Question: in weather station 17, which store sold the highest quantity of item 45 in october 2012? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel...
in weather station 17, which store sold the highest quantity of item 45 in october 2012?
sales_in_weather
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
Question: what are the items sold by the store during the day whose station recorded the thickest snowfall? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure,...
what are the items sold by the store during the day whose station recorded the thickest snowfall?
sales_in_weather
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
Question: what are the top 3 stations that have sold the highest quantities for an item in a single day? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, se...
what are the top 3 stations that have sold the highest quantities for an item in a single day?
sales_in_weather
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
Question: how many stores belong to the station with the highest recorded heat of all time? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resul...
how many stores belong to the station with the highest recorded heat of all time?
sales_in_weather
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'
Question: on february 8, 2014, what is the minimum temperature in the station where store 29 belongs? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, seale...
on february 8, 2014, what is the minimum temperature in the station where store 29 belongs?
sales_in_weather
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 )
Question: among the stations with 3 stores, how many stations have a station pressure of no more than 30 on february 18, 2014? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, precip...
among the stations with 3 stores, how many stations have a station pressure of no more than 30 on february 18, 2014?
sales_in_weather
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'
Question: which station has the highest number of stores? calculate the said station's average maximum temperature in february 2012. | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, ...
which station has the highest number of stores? calculate the said station's average maximum temperature in february 2012.
sales_in_weather
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%'
Question: between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpre...
between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014?
sales_in_weather
select max(avgspeed) from weather
Question: what is the maximum average speed? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. relation -> store_...
what is the maximum average speed?
sales_in_weather
select count(distinct `date`) from weather where snowfall > 5
Question: how many days did the show fell more than 5 inches? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. r...
how many days did the show fell more than 5 inches?
sales_in_weather
select count(distinct `date`) as days from weather where sunrise < time('05:00:00')
Question: how many days did the sun rise before 5 am? | Tables: sales_in_weather -> date, store_nbr, item_nbr, units. weather -> station_nbr, date, tmax, tmin, tavg, depart, dewpoint, wetbulb, heat, cool, sunrise, sunset, codesum, snowfall, preciptotal, stnpressure, sealevel, resultspeed, resultdir, avgspeed. relation ...
how many days did the sun rise before 5 am?