db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
address
select distinct t1.county from country as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.population_2010 > 10000
Question: indicate the name of the country with a population greater than 10000 in 2010. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_co...
indicate the name of the country with a population greater than 10000 in 2010.
address
select t1.county from country as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code group by t1.county order by t2.households desc limit 1
Question: name the country with the largest number of households in a residential area. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_cou...
name the country with the largest number of households in a residential area.
address
select cast(count(case when t2.households > 10000 then t1.zip_code else null end) as real) * 100 / count(t1.zip_code) from country as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code
Question: calculate the percentage of households in residential areas of countries over 10000. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, mu...
calculate the percentage of households in residential areas of countries over 10000.
address
select cast(count(case when t2.type = 'post office' then t1.zip_code else null end) as real) * 100 / count(t1.zip_code) from country as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.county = 'saint croix'
Question: among the types of postal points in saint croix, what percentage of postal points is the post office? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code...
among the types of postal points in saint croix, what percentage of postal points is the post office?
address
select distinct t2.county from area_code as t1 inner join country as t2 on t1.zip_code = t2.zip_code inner join zip_data as t3 on t1.zip_code = t3.zip_code where t1.area_code = '787' and t3.type = 'unique post office'
Question: among the area code 787, list the country of the cities with a postal point type of unique postal office. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_...
among the area code 787, list the country of the cities with a postal point type of unique postal office.
address
select t2.elevation from alias as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.alias = 'east longmeadow'
Question: what is the elevation of the city with the alias east longmeadow? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, type, o...
what is the elevation of the city with the alias east longmeadow?
address
select count(t1.area_code) from area_code as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.daylight_savings = 'no'
Question: in cities that do not implement daylight savings, what is the total number of cities? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, m...
in cities that do not implement daylight savings, what is the total number of cities?
address
select t2.county, t1.area_code from area_code as t1 inner join country as t2 on t1.zip_code = t2.zip_code where t1.zip_code = 1116
Question: give the country and area code of the city with zip code 1116. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, type, orga...
give the country and area code of the city with zip code 1116.
address
select distinct t2.type from alias as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.alias = 'st thomas'
Question: among the cities with alias st thomas, provide the type of postal point for each city. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, ...
among the cities with alias st thomas, provide the type of postal point for each city.
address
select t3.city from state as t1 inner join country as t2 on t1.abbreviation = t2.state inner join zip_data as t3 on t2.zip_code = t3.zip_code where t1.name = 'oklahoma' and t2.county = 'noble'
Question: list down the names of the cities belonging to noble, oklahoma. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, type, org...
list down the names of the cities belonging to noble, oklahoma.
address
select t1.area_code from area_code as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.water_area = ( select max(water_area) from zip_data )
Question: among the listed cities, provide the area code of the city with the largest water area. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state,...
among the listed cities, provide the area code of the city with the largest water area.
address
select t1.alias from alias as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.population_2020 = ( select max(population_2020) from zip_data )
Question: provide the alias of the city with the highest population in year 2020. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, t...
provide the alias of the city with the highest population in year 2020.
address
select t3.elevation from state as t1 inner join country as t2 on t1.abbreviation = t2.state inner join zip_data as t3 on t2.zip_code = t3.zip_code where t1.name = 'massachusetts' and t2.county = 'hampden' group by t3.elevation
Question: what is the elevation of the city belonging to hampden, massachusetts? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, ty...
what is the elevation of the city belonging to hampden, massachusetts?
address
select t1.area_code from area_code as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.hispanic_population = ( select max(hispanic_population) from zip_data )
Question: list the area code of the city with the highest hispanic population. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, type...
list the area code of the city with the highest hispanic population.
address
select t1.alias from alias as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.asian_population = 7
Question: give the alias of the cities with an asian population of 7. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, type, organiz...
give the alias of the cities with an asian population of 7.
address
select avg(t2.white_population) from area_code as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.area_code = 920
Question: what is the average of the white population in the cities with area code 920? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_cou...
what is the average of the white population in the cities with area code 920?
address
select cast(count(case when t2.county_fips < 20 then t2.zip_code else null end) as real) * 100 / count(t2.zip_code) from alias as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.alias = 'ponce'
Question: among the cities with alias ponce, what is the percentage of cities with a country level fips code of less than 20? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_da...
among the cities with alias ponce, what is the percentage of cities with a country level fips code of less than 20?
address
select t1.county from country as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.population_2020 > 0.97 * ( select avg(population_2020) from zip_data )
Question: list down the country of the cities with a population greater than 97% of the average population of all countries in 2020. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area....
list down the country of the cities with a population greater than 97% of the average population of all countries in 2020.
address
select count(t2.zip_code) from congress as t1 inner join zip_congress as t2 on t1.cognress_rep_id = t2.district where t1.first_name = 'kirkpatrick' and t1.last_name = 'ann'
Question: count the number of postal points in the district represented by kirkpatrick ann. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi...
count the number of postal points in the district represented by kirkpatrick ann.
address
select t2.zip_code, t2.latitude, t2.longitude from cbsa as t1 inner join zip_data as t2 on t1.cbsa = t2.cbsa where t1.cbsa_name = 'allentown-bethlehem-easton, pa-nj'
Question: provide the zip codes and coordinates of the postal points under allentown-bethlehem-easton, pa-nj. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, ...
provide the zip codes and coordinates of the postal points under allentown-bethlehem-easton, pa-nj.
address
select t1.zip_code, t2.city, t2.latitude, t2.longitude from avoid as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t1.bad_alias = 'shared reshipper'
Question: provide the zip codes, cities, and locations of the postal points that have shared reshipper as a bad alias. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> z...
provide the zip codes, cities, and locations of the postal points that have shared reshipper as a bad alias.
address
select t3.first_name, t3.last_name from zip_data as t1 inner join zip_congress as t2 on t1.zip_code = t2.zip_code inner join congress as t3 on t2.district = t3.cognress_rep_id where t1.city = 'garfield'
Question: who are the congress representatives of the postal points in garfield? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, ty...
who are the congress representatives of the postal points in garfield?
address
select count(t2.zip_code) from cbsa as t1 inner join zip_data as t2 on t1.cbsa = t2.cbsa where t1.cbsa_name = 'new york-newark-jersey city, ny-nj-pa'
Question: count the number of postal points under new york-newark-jersey city, ny-nj-pa. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_co...
count the number of postal points under new york-newark-jersey city, ny-nj-pa.
address
select count(t2.zip_code) from congress as t1 inner join zip_congress as t2 on t1.cognress_rep_id = t2.district where t1.state = 'puerto rico'
Question: how many postal points are there under the congress representative in puerto rico? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, mult...
how many postal points are there under the congress representative in puerto rico?
address
select count(distinct t2.zip_code), count(distinct t2.county) from state as t1 inner join country as t2 on t1.abbreviation = t2.state where t1.name = 'west virginia'
Question: describe the number of postal points and the countries in west virginia. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, ...
describe the number of postal points and the countries in west virginia.
address
select t1.zip_code, t1.area_code from area_code as t1 inner join zip_data as t2 on t1.zip_code = t2.zip_code where t2.type = 'community post office ' and t2.elevation > 6000
Question: provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area....
provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000.
address
select count(t2.zip_code) from congress as t1 inner join zip_congress as t2 on t1.cognress_rep_id = t2.district where t1.state = 'mississippi'
Question: how many postal points are there under the congress representative from the house of representatives in mississippi? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_d...
how many postal points are there under the congress representative from the house of representatives in mississippi?
address
select t2.district from zip_data as t1 inner join zip_congress as t2 on t1.zip_code = t2.zip_code where t1.city = 'east springfield'
Question: provide the congress representatives' ids of the postal points in east springfield. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, mul...
provide the congress representatives' ids of the postal points in east springfield.
address
select t1.cbsa_name from cbsa as t1 inner join zip_data as t2 on t1.cbsa = t2.cbsa where t2.employees = ( select max(employees) from zip_data )
Question: who is the cbsa officer of the post point in the area with the highest number of employees? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, st...
who is the cbsa officer of the post point in the area with the highest number of employees?
address
select count(t2.zip_code) from state as t1 inner join zip_data as t2 on t1.abbreviation = t2.state where t1.name = 'ohio' and t2.type = 'unique post office'
Question: how many postal points with unique post office types are there in ohio? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, t...
how many postal points with unique post office types are there in ohio?
address
select cast(sum(t2.total_beneficiaries) as real) / count(t2.zip_code) from state as t1 inner join zip_data as t2 on t1.abbreviation = t2.state where t1.name = 'guam'
Question: calculate the average number of beneficiaries per postal point in guam. | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, District, land_area. zip_data -> zip_code, city, state, multi_county, t...
calculate the average number of beneficiaries per postal point in guam.
address
select cast(sum(case when t1.party = 'democrat' then 1 else 0 end) as real) * 100 / count(*), sum(case when t1.state = 'hawaii' then 1 else 0 end) from congress as t1 inner join zip_congress as t2 on t1.cognress_rep_id = t2.district
Question: calculate the percentage of congress representatives from the democrat party. among them, how many postal points are in the hawaii state? | Tables: CBSA -> CBSA, CBSA_name, CBSA_type. state -> abbreviation, name. congress -> cognress_rep_id, first_name, last_name, CID, party, state, abbreviation, House, Distr...
calculate the percentage of congress representatives from the democrat party. among them, how many postal points are in the hawaii state?
beer_factory
select brandname from rootbeerbrand where firstbrewedyear = ( select min(firstbrewedyear) from rootbeerbrand )
Question: what is the name of the root beer brand that has the longest history? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName,...
what is the name of the root beer brand that has the longest history?
beer_factory
select count(brandid) from rootbeerbrand where country = 'united states'
Question: how many breweries are located in north america? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City,...
how many breweries are located in north america?
beer_factory
select brandname from rootbeerbrand where facebookpage is not null
Question: please list the names of all the root beer brands that are advertised on facebook. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, ...
please list the names of all the root beer brands that are advertised on facebook.
beer_factory
select brandname from rootbeerbrand order by currentretailprice - wholesalecost limit 1
Question: what is the name of the root beer brand with the lowest unit profit available to wholesalers? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> L...
what is the name of the root beer brand with the lowest unit profit available to wholesalers?
beer_factory
select description from rootbeerbrand where brandname = 'a&w'
Question: what is the description of the root beer brand a&w? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, Ci...
what is the description of the root beer brand a&w?
beer_factory
select city from rootbeerbrand where breweryname = 'aj stephans beverages'
Question: in which city is the brewery aj stephans beverages located? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAdd...
in which city is the brewery aj stephans beverages located?
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.first = 'frank-paul' and t1.last = 'santangelo' and strftime('%y-%m', t2.transactiondate) = '2014-07'
Question: how many transactions had frank-paul santangelo made in july, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, S...
how many transactions had frank-paul santangelo made in july, 2014?
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.gender = 'm' and strftime('%y-%m', t2.transactiondate) = '2014-07'
Question: among the transactions made in july, 2014, how many of them were made by a male customer? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> Locat...
among the transactions made in july, 2014, how many of them were made by a male customer?
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.subscribedtoemaillist = 'true' and t2.creditcardtype = 'visa' and strftime('%y-%m', t2.transactiondate) = '2014-07'
Question: among the users that permit the company to send regular emails to them, how many of them had made a transaction with a visa card in july, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation...
among the users that permit the company to send regular emails to them, how many of them had made a transaction with a visa card in july, 2014?
beer_factory
select t1.first, t1.last from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where strftime('%y-%m', t2.transactiondate) = '2014-08' group by t1.customerid order by count(t2.customerid) desc limit 1
Question: what is the full name of the customer that had made the most transactions in august, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> Loca...
what is the full name of the customer that had made the most transactions in august, 2014?
beer_factory
select distinct t4.brandname from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid inner join rootbeerbrand as t4 on t3.brandid = t4.brandid where t1.first = 'frank-paul' and t1.last = 'santangelo' and t2.transactiondate = '2014-0...
Question: please list the brands of all the root beer that frank-paul santangelo had purchased on 2014/7/7. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location ...
please list the brands of all the root beer that frank-paul santangelo had purchased on 2014/7/7.
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid where t1.first = 'frank-paul' and t1.last = 'santangelo' and t2.transactiondate = '2014-07-07' and t3.containertype = 'can'
Question: of the 4 root beers that frank-paul santangelo purchased on 2014/7/7, how many of them were in cans? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. locati...
of the 4 root beers that frank-paul santangelo purchased on 2014/7/7, how many of them were in cans?
beer_factory
select count(t1.brandid) from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t2.transactiondate like '2014-08%' and t3.brandname = 'bulldog'
Question: how many root beers of the bulldog were purchased in august, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, St...
how many root beers of the bulldog were purchased in august, 2014?
beer_factory
select t1.first, t1.last from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid inner join rootbeerbrand as t4 on t3.brandid = t4.brandid where t4.breweryname = 'aj stephans beverages'
Question: please list the full names of the customers who have purchased at least one root beer produced by aj stephans beverages. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitud...
please list the full names of the customers who have purchased at least one root beer produced by aj stephans beverages.
beer_factory
select count(t1.brandid) from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t2.transactiondate like '2014-08%' and t3.twitter is null
Question: among the root beer brands that do not advertise on twitter, how many of them have root beers sold in august, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Lo...
among the root beer brands that do not advertise on twitter, how many of them have root beers sold in august, 2014?
beer_factory
select distinct t2.creditcardnumber from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.first = 'frank-paul' and t1.last = 'santangelo' and t2.transactiondate = '2014-07-07'
Question: what is the number of the credit card that frank-paul santangelo used to purchase root beers on 2014/7/7? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. l...
what is the number of the credit card that frank-paul santangelo used to purchase root beers on 2014/7/7?
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid inner join rootbeerbrand as t4 on t3.brandid = t4.brandid where t1.first = 'frank-paul' and t1.last = 'santangelo' and t4.artificialsweetener = 'fal...
Question: among all the root beers purchased by frank-paul santangelo, how many of them were non-sweetened? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location ...
among all the root beers purchased by frank-paul santangelo, how many of them were non-sweetened?
beer_factory
select t2.transactiondate from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.gender = 'm' group by t2.transactiondate having count(t2.customerid) > 3
Question: please list the dates on which a male customer has purchased more than 3 root beers. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID...
please list the dates on which a male customer has purchased more than 3 root beers.
beer_factory
select cast(count(t1.brandid) as real) / 31 from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t2.transactiondate like '2014-08%' and t3.brandname = 'a&w'
Question: what is the average number of root beers of the brand a&w sold in a day in august, 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> Locati...
what is the average number of root beers of the brand a&w sold in a day in august, 2014?
beer_factory
select cast(count(case when t3.breweryname = 'aj stephans beverages' then 1 else null end) as real) * 100 / count(t1.brandid) from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t2.transactiondate like '2014%'
Question: among all the root beers sold in 2014, what is the percentage of the root beers produced by the brewery aj stephans beverages? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, L...
among all the root beers sold in 2014, what is the percentage of the root beers produced by the brewery aj stephans beverages?
beer_factory
select count(t2.customerid) from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid where t1.first = 'james' and t1.last = 'house'
Question: tell the number of reviews given by james house. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City,...
tell the number of reviews given by james house.
beer_factory
select distinct t2.creditcardnumber from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.first = 'lisa' and t1.last = 'ling'
Question: show the credit card number of lisa ling. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City, State,...
show the credit card number of lisa ling.
beer_factory
select t2.latitude, t2.longitude from location as t1 inner join geolocation as t2 on t1.locationid = t2.locationid where t1.locationname = 'sac state american river courtyard'
Question: state the coordinate of sac state american river courtyard. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAdd...
state the coordinate of sac state american river courtyard.
beer_factory
select t2.locationname from `transaction` as t1 inner join location as t2 on t1.locationid = t2.locationid where t1.transactionid = 100885
Question: provide the name of the location where transaction no.100885 happened. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName...
provide the name of the location where transaction no.100885 happened.
beer_factory
select t1.city from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t2.transactionid = 103545
Question: which city does the customer who finished transaction no.103545 live in? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationNa...
which city does the customer who finished transaction no.103545 live in?
beer_factory
select distinct t1.phonenumber from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t2.creditcardnumber = 6011179359005382
Question: what is the phone number of the customer who owns the credit card of number 6011179359005380? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> L...
what is the phone number of the customer who owns the credit card of number 6011179359005380?
beer_factory
select t1.first, t1.last from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid group by t1.customerid order by count(t2.customerid) desc limit 1
Question: which customer has the most reviews? state the full name. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddre...
which customer has the most reviews? state the full name.
beer_factory
select t1.firstpurchasedate from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid where t2.review = 'tastes like australia.'
Question: for the customer who leaves the review content of 'tastes like australia.', when was his/her first purchase date? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Long...
for the customer who leaves the review content of 'tastes like australia.', when was his/her first purchase date?
beer_factory
select t2.transactiondate from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.first = 'natalie' and t1.last = 'dorris' order by t2.transactiondate limit 1
Question: when did natalie dorris buy her first root beer? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City,...
when did natalie dorris buy her first root beer?
beer_factory
select t1.breweryname from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t2.starrating = 5 group by t1.brandid order by count(t2.starrating) desc limit 1
Question: for the root beer brand with the most 5 star ratings, what is the name of the brewery? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> Location...
for the root beer brand with the most 5 star ratings, what is the name of the brewery?
beer_factory
select case when t1.subscribedtoemaillist like 'true' then 'yes' else 'no' end as result from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid inner join rootbeerbrand as t3 on t2.brandid = t3.brandid where t2.starrating = 3 and t3.brandname = 'frostie' and t2.reviewdate = '2014-04-24'
Question: for the customer who gave a 3 star rating to frostie brand on 2014/4/24, did the user permit the company to send regular emails to him/her? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> ...
for the customer who gave a 3 star rating to frostie brand on 2014/4/24, did the user permit the company to send regular emails to him/her?
beer_factory
select t1.currentretailprice - t1.wholesalecost as price from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t2.review = 'the quintessential dessert root beer. no ice cream required.'
Question: for the root beer brand which got the review with the content of 'the quintessential dessert root beer. no ice cream required.', what is the current retail price of the root beer? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, Subscr...
for the root beer brand which got the review with the content of 'the quintessential dessert root beer. no ice cream required.', what is the current retail price of the root beer?
beer_factory
select cast(count(case when t2.starrating = 5 then 1 else null end) as real) * 100 / count(t2.starrating) from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t1.brandname = 'river city'
Question: what is the percentage of 5 star ratings river city brand root beer get? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationNa...
what is the percentage of 5 star ratings river city brand root beer get?
beer_factory
select cast(count(*) as real) / count(distinct t1.brandid) as avgreview from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t1.state = 'ca'
Question: what is the average number of reviews of all the root beer brands from 'ca' state? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, ...
what is the average number of reviews of all the root beer brands from 'ca' state?
beer_factory
select count(customerid) from customers where gender = 'f' and subscribedtoemaillist = 'true'
Question: how many female customers permit the company to send regular emails to them? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, Locati...
how many female customers permit the company to send regular emails to them?
beer_factory
select brandname from rootbeerbrand order by firstbrewedyear desc limit 1
Question: what is the name of the brand of the beer with the shortest brewed history? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, Locatio...
what is the name of the brand of the beer with the shortest brewed history?
beer_factory
select first, last from customers order by firstpurchasedate limit 10
Question: what are the full names of the first top 10 customers? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress,...
what are the full names of the first top 10 customers?
beer_factory
select count(breweryname) from rootbeerbrand where country = 'australia'
Question: how many breweries are there in australia? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City, State...
how many breweries are there in australia?
beer_factory
select count(customerid) from customers where first = 'charles' and city = 'sacramento'
Question: how many customers are named charles in sacramento? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, Ci...
how many customers are named charles in sacramento?
beer_factory
select count(transactionid) from `transaction` where creditcardtype = 'mastercard' and transactiondate like '2014%'
Question: how many transactions were paid through mastercard in 2014? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAdd...
how many transactions were paid through mastercard in 2014?
beer_factory
select t3.brandname from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid inner join rootbeerbrand as t3 on t2.brandid = t3.brandid where t1.first = 'jayne' and t1.last = 'collins' and t2.starrating = 1
Question: which brand of root beer did jayne collins give the lowest rating? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, St...
which brand of root beer did jayne collins give the lowest rating?
beer_factory
select count(t1.brandid) from rootbeer as t1 inner join rootbeerbrand as t2 on t1.brandid = t2.brandid inner join location as t3 on t1.locationid = t3.locationid where t3.locationname = 'sac state american river courtyard' and t1.purchasedate like '2015%' and t2.honey = 'true' and t2.canesugar = 'false' and t1.containe...
Question: how many sweet bottled root beers that do not contain cane sugar were purchased in 2015 through the selling company located in sac state american river courtyard? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, ...
how many sweet bottled root beers that do not contain cane sugar were purchased in 2015 through the selling company located in sac state american river courtyard?
beer_factory
select t2.breweryname from rootbeer as t1 inner join rootbeerbrand as t2 on t1.brandid = t2.brandid where t1.purchasedate between '2016-01-01' and '2016-12-31' group by t2.brandid order by count(t1.brandid) desc limit 1
Question: which brewery does the most purchased root beer in 2016 belong to? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, St...
which brewery does the most purchased root beer in 2016 belong to?
beer_factory
select t1.first, t1.last from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid inner join rootbeerbrand as t3 on t2.brandid = t3.brandid where t3.brandname = 'river city' and t2.starrating = 5
Question: what are the full names of the customer who gave river city a 5-star? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName,...
what are the full names of the customer who gave river city a 5-star?
beer_factory
select count(t2.rootbeerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid where t1.first = 'tom' and t1.last = 'hanks' and t2.transactiondate between '2015-01-01' and '2016-12-31'
Question: how many root beers did tom hanks purchase between 2015 to 2016? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, Stre...
how many root beers did tom hanks purchase between 2015 to 2016?
beer_factory
select t1.brandname from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t2.starrating = 5
Question: which brand of root beer was highly rated by customers? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress...
which brand of root beer was highly rated by customers?
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid inner join rootbeerbrand as t4 on t3.brandid = t4.brandid where t1.first = 'nicholas' and t1.last = 'sparks' and t4.brandname like 'henry weinhard%s...
Question: how many henry weinhard's were bought by nicholas sparks? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddre...
how many henry weinhard's were bought by nicholas sparks?
beer_factory
select t2.breweryname from rootbeer as t1 inner join rootbeerbrand as t2 on t1.brandid = t2.brandid where t2.facebookpage is null and t2.twitter is null group by t2.brandid order by count(t1.brandid) desc limit 1
Question: among the root beer brands that do not advertise on facebook and twitter, which brand has the highest number of purchases? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latit...
among the root beer brands that do not advertise on facebook and twitter, which brand has the highest number of purchases?
beer_factory
select t3.locationname from rootbeer as t1 inner join rootbeerbrand as t2 on t1.brandid = t2.brandid inner join location as t3 on t1.locationid = t3.locationid where t2.brandname = 'dog n suds' and t3.locationname in ('sac state american river courtyard', 'sac state union') group by t1.locationid order by count(t1.bran...
Question: between sac state union and sac state american river courtyard, which location sold the most dog n suds root beer? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Lon...
between sac state union and sac state american river courtyard, which location sold the most dog n suds root beer?
beer_factory
select count(t1.brandid) from rootbeer as t1 inner join rootbeerbrand as t2 on t1.brandid = t2.brandid where t1.containertype = 'can' and t2.brandname = 'a&w' and t1.purchasedate like '2016%'
Question: how many canned a&w were purchased in 2016? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City, Stat...
how many canned a&w were purchased in 2016?
beer_factory
select t2.latitude, t2.longitude from location as t1 inner join geolocation as t2 on t1.locationid = t2.locationid where t1.locationname = 'sac state union'
Question: what is the precise location of sac state union? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddress, City,...
what is the precise location of sac state union?
beer_factory
select t1.brandname from rootbeerbrand as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid where t2.starrating = 5 group by t2.brandid having count(t2.starrating) >= 5
Question: what are the brands of the root beers that received 5-star ratings from no less than 5 customers? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location ...
what are the brands of the root beers that received 5-star ratings from no less than 5 customers?
beer_factory
select t1.brandname , cast(sum(case when t2.purchasedate >= '2014-01-01' and t2.purchasedate <= '2016-12-31' then 1 else 0 end) as real) / count(t2.brandid) as purchase from rootbeerbrand as t1 inner join rootbeer as t2 on t1.brandid = t2.brandid where t1.breweryname = 'dr pepper snapple group' group by t2.brandid
Question: list the brands of root beer produced by dr pepper snapple group and calculate their percentage of purchases between 2014 to 2016. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationI...
list the brands of root beer produced by dr pepper snapple group and calculate their percentage of purchases between 2014 to 2016.
beer_factory
select t3.brandname, t2.customerid from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid group by t3.brandid order by t3.currentretailprice - t3.wholesalecost, count(t1.brandid) desc limit 1
Question: which brand of root beer has the lowest unit profit available to wholesalers? indicate the id of the customer that has the highest number of purchases of the said brand. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmai...
which brand of root beer has the lowest unit profit available to wholesalers? indicate the id of the customer that has the highest number of purchases of the said brand.
beer_factory
select first, last, phonenumber from customers where gender = 'm' and city = 'fair oaks' and subscribedtoemaillist = 'true'
Question: list the full name and phone number of male customers from fair oaks who are subscribed to the email list. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. ...
list the full name and phone number of male customers from fair oaks who are subscribed to the email list.
beer_factory
select cast(count(case when containertype = 'can' then rootbeerid else null end) as real) * 100 / count(rootbeerid) from rootbeer where purchasedate like '2014%'
Question: among the root beer purchased in 2014, what percentage were sold in cans? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationN...
among the root beer purchased in 2014, what percentage were sold in cans?
beer_factory
select brandname from rootbeerbrand where firstbrewedyear between '1996' and '2000' order by firstbrewedyear desc
Question: give the name of the brands that brewed their first drink between 1996 and 2000 in the descending order of the date brewed. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Lati...
give the name of the brands that brewed their first drink between 1996 and 2000 in the descending order of the date brewed.
beer_factory
select brandid from rootbeerreview where starrating = 1 group by brandid order by count(brandid) desc limit 1
Question: find the brand id of the root beer which has the most number of customers who gave 1-star ratings. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location...
find the brand id of the root beer which has the most number of customers who gave 1-star ratings.
beer_factory
select cast(count(case when creditcardtype = 'visa' then transactionid else null end) as real) * 100 / count(transactionid) from `transaction`
Question: among the transactions, what percentage is done by using a visa card? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName,...
among the transactions, what percentage is done by using a visa card?
beer_factory
select count(brandid) from rootbeerbrand where cornsyrup = 'true' and artificialsweetener = 'true' and availableincans = 'true'
Question: how many brands of root beers are available in cans and contain corn syrup and artificial sweeteners? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. locat...
how many brands of root beers are available in cans and contain corn syrup and artificial sweeteners?
beer_factory
select cast(count(case when t2.locationname = 'sac state american river courtyard' then 1 else null end) as real) * 100 / count(t1.transactionid) from `transaction` as t1 inner join location as t2 on t1.locationid = t2.locationid
Question: calculate the percentage of sales done at sac state american river courtyard. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, Locat...
calculate the percentage of sales done at sac state american river courtyard.
beer_factory
select cast(count(t2.rootbeerid) as real) / count(distinct t2.purchasedate) from rootbeerbrand as t1 inner join rootbeer as t2 on t1.brandid = t2.brandid inner join `transaction` as t3 on t2.rootbeerid = t3.rootbeerid where t1.caffeinated = 'true'
Question: on average how many caffeinated root beers are sold a day? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, LocationName, StreetAddr...
on average how many caffeinated root beers are sold a day?
beer_factory
select * from ( select t1.brandname, t2.containertype from rootbeerbrand as t1 inner join rootbeer as t2 on t1.brandid = t2.brandid order by t1.currentretailprice - t1.wholesalecost desc limit 1 ) union all select * from ( select t3.brandname, t4.containertype from rootbeerbrand as t3 inner join rootbeer as t4 on t3.br...
Question: find the root beer with the most and least amount of profit per unit and list the container types in which these root beers are sold. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> Locati...
find the root beer with the most and least amount of profit per unit and list the container types in which these root beers are sold.
beer_factory
select avg(t2.purchaseprice) from rootbeer as t1 inner join `transaction` as t2 on t1.rootbeerid = t2.rootbeerid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t1.containertype = 'bottle' and t2.purchaseprice > 2
Question: what is the average cost of root beers purchased for more than 2 dollars and sold in bottles? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> L...
what is the average cost of root beers purchased for more than 2 dollars and sold in bottles?
beer_factory
select count(t4.brandid) from `transaction` as t1 inner join geolocation as t2 on t1.locationid = t2.locationid inner join location as t3 on t1.locationid = t3.locationid inner join rootbeer as t4 on t1.rootbeerid = t4.rootbeerid where t2.latitude = 38.559615 and t2.longitude = -121.42243 and t4.containertype = 'bottle...
Question: among the root beers sold in bottles, how many are sold at the location 38.559615, -121.42243? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> ...
among the root beers sold in bottles, how many are sold at the location 38.559615, -121.42243?
beer_factory
select cast(count(case when t2.starrating > 3 then 1 else null end) as real) * 100 / count(t2.customerid) from customers as t1 inner join rootbeerreview as t2 on t1.customerid = t2.customerid where t1.subscribedtoemaillist = 'false'
Question: among the customers not subscribed to the mailing list, what percentage has given three or more stars in a review? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Lon...
among the customers not subscribed to the mailing list, what percentage has given three or more stars in a review?
beer_factory
select t3.brandname from rootbeer as t1 inner join rootbeerreview as t2 on t1.brandid = t2.brandid inner join rootbeerbrand as t3 on t1.brandid = t3.brandid where t2.starrating = 5 and strftime('%y', t2.reviewdate) = '2012' group by t1.brandid order by count(t2.brandid) desc limit 1
Question: which root beer got the most five stars in 2012? give the brand name of this beer. | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> LocationID, ...
which root beer got the most five stars in 2012? give the brand name of this beer.
beer_factory
select count(t1.customerid) from customers as t1 inner join `transaction` as t2 on t1.customerid = t2.customerid inner join rootbeer as t3 on t2.rootbeerid = t3.rootbeerid inner join rootbeerbrand as t4 on t3.brandid = t4.brandid where t1.gender = 'f' and t4.artificialsweetener = 'true'
Question: in the female customers, how many bought root beer that contains artificial sweetener? | Tables: customers -> CustomerID, First, Last, StreetAddress, City, State, ZipCode, Email, PhoneNumber, FirstPurchaseDate, SubscribedToEmailList, Gender. geolocation -> LocationID, Latitude, Longitude. location -> Location...
in the female customers, how many bought root beer that contains artificial sweetener?