Chinastark/bird_dataset huggingface dataset:
Database: address
Question: What are the zip code for the Senate house?
Evidence: House of Repsentatives can stand for senate house
SQL: SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.House = 'House of Repsentatives' GROUP BY T2.zip_code
Database: address
Question: Which city has the most bad aliases?
Evidence: the most bad aliases refer to MAX(COUNT(bad_alias));
SQL: SELECT T2.city FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.bad_alias ORDER BY COUNT(T1.zip_code) DESC LIMIT 1
Database: address
Question: List all the counties in Georgia.
Evidence: Georgia is the name of the state, in which name = 'Georgia';
SQL: SELECT T2.county FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Georgia' GROUP BY T2.county
Database: address
Question: List all the locations of postal points with the area code "410".
Evidence: latitude and longitude coordinates can be used to identify the location; postal points refer to zip_code;
SQL: SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 410
Database: address
Question: What is the name of the CBSA of the city with the highest average house value?
Evidence: the highest average house value refers to avg_house_value;
SQL: SELECT DISTINCT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1
Database: address
Question: What are the bad aliases of the postal points from East Setauket?
Evidence: East Setauket is the city;
SQL: SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'East Setauket'
Database: address
Question: What was the population of Wilcox County in 2010?
Evidence: population of Wilcox County in 2010 refers to SUM(population_2010) where county = 'WILCOX';
SQL: SELECT SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WILCOX'
Database: address
Question: What is the code of the area with the largest Asian population?
Evidence: the code of the area refers to area_code; area with the largest Asian population refers to MAX(asian_population);
SQL: SELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.asian_population ORDER BY T2.asian_population DESC LIMIT 1
Database: address
Question: List all the cities with micro CBSA.
Evidence: micro CBSA refers to CBSA_type = 'Micro';
SQL: SELECT T2.city FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Micro'
Database: address
Question: What is the name of the state with the most counties?
Evidence: the most counties refer to MAX(COUNT(county));
SQL: SELECT T1.name FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state GROUP BY T2.state ORDER BY COUNT(T2.county) DESC LIMIT 1
Database: address
Question: What is the number of households in the "FL-10" district?
SQL: SELECT SUM(CASE WHEN T2.district = 'FL-10' THEN 1 ELSE 0 END) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code
Database: address
Question: What is the average household income in the city known as "Danzig"?
Evidence: average household income refers to avg_income_per_household; city known as "Danzig" refers to bad_alias = 'Danzig';
SQL: SELECT T2.avg_income_per_household FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Danzig'
Database: address
Question: What are the states with an above-average female population?
Evidence: above-average female population refers to female_population > DIVIDE(SUM(female_population), COUNT(state));
SQL: SELECT DISTINCT T2.state FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T2.female_population > ( SELECT AVG(female_population) FROM zip_data )
Database: address
Question: What percentage of households are in "Coroyell" out of its state?
Evidence: DIVIDE(SUM(households where county = 'CORYELL'), SUM(households)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T1.county = 'CORYELL' THEN T2.households ELSE 0 END) AS REAL) * 100 / SUM(T2.households) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
Database: address
Question: What is the name and the position of the CBSA officer in the city of Cabo Rojo?
Evidence: name of the CBSA officer refers to CBSA_name; position of the CBSA officer refers to CBSA_type;
SQL: SELECT T1.CBSA_name, T1.CBSA_type FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Cabo Rojo' GROUP BY T1.CBSA_name, T1.CBSA_type
Database: address
Question: Indicate the country name of the city Las Marias.
SQL: SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Las Marias'
Database: address
Question: How many cities does congressman Pierluisi Pedro represent?
SQL: SELECT COUNT(DISTINCT T1.city) 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 T3.first_name = 'Pierluisi' AND T3.last_name = 'Pedro'
Database: address
Question: Provide the names of bad aliases in the city of Aguadilla.
SQL: SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Aguadilla'
Database: address
Question: Indicate the name of the congressman represent in Guanica.
Evidence: name of congressman implies full name which refers to first_name, last_name; Guanica is the city;
SQL: 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 = 'Guanica'
Database: address
Question: Which state has the most bad aliases?
Evidence: the most bad aliases refer to MAX(COUNT(bad_alias));
SQL: SELECT T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.state ORDER BY COUNT(T1.bad_alias) DESC LIMIT 1
Database: address
Question: What is the difference in the number of bad alias between Aguada city and Aguadilla city?
Evidence: SUBTRACT(COUNT(bad_alias where city = 'Aguada'), COUNT(bad_alias where city = 'Aguadilla'));
SQL: SELECT COUNT(CASE WHEN T2.city = 'Aguada' THEN T1.bad_alias ELSE NULL END) - COUNT(CASE WHEN T2.city = 'Aguadilla' THEN T1.bad_alias ELSE NULL END) AS DIFFERENCE FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
Database: address
Question: Which state has greater than 50 CBSA officers of metro type?
Evidence: greater than 50 CBSA officers of metro type refers to COUNT(CBSA_type = 'Metro') > 50;
SQL: SELECT T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Metro' GROUP BY T2.state HAVING COUNT(T1.CBSA_type) > 50
Database: address
Question: Provide the population of Arecibo in 2020.
Evidence: population of Arecibo in 2020 refers to SUM(population_2020) where county = 'ARECIBO';
SQL: SELECT SUM(T2.population_2020) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'ARECIBO'
Database: address
Question: Indicate the name of the country with a population greater than 10000 in 2010.
Evidence: population greater than 10000 in 2010 refers to population_2010 > 10000;
SQL: 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
Database: address
Question: Name the country with the largest number of households in a residential area.
Evidence: the largest number of households refers to MAX(households);
SQL: 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
Database: address
Question: Calculate the percentage of households in residential areas of countries over 10000.
Evidence: DIVIDE(SUM(households > 10000), SUM(households)) as percentage;
SQL: 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
Database: address
Question: Among the types of postal points in Saint Croix, what percentage of postal points is the post office?
Evidence: DIVIDE(COUNT(type = 'Post Office' ), COUNT(type)) as percentage where county = 'SAINT CROIX';
SQL: 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'
Database: address
Question: Among the area code 787, list the country of the cities with a postal point type of unique postal office.
Evidence: postal point type of unique postal office refers to type = 'Unique Post Office';
SQL: 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'
Database: address
Question: What is the elevation of the city with the alias East Longmeadow?
SQL: 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'
Database: address
Question: In cities that do not implement daylight savings, what is the total number of cities?
Evidence: do not implement daylight savings refers to daylight_savings = 'No';
SQL: 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'
Database: address
Question: Give the country and area code of the city with zip code 1116.
SQL: 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
Database: address
Question: Among the cities with alias St Thomas, provide the type of postal point for each city.
SQL: 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'
Database: address
Question: List down the names of the cities belonging to Noble, Oklahoma.
Evidence: the county of Noble is located in the state of Oklahoma;
SQL: 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'
Database: address
Question: Among the listed cities, provide the area code of the city with the largest water area.
Evidence: the largest water area refers to MAX(water_area);
SQL: 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 )
Database: address
Question: Provide the alias of the city with the highest population in year 2020.
Evidence: the highest population in year 2020 refers to MAX(population_2020);
SQL: 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 )
Database: address
Question: What is the elevation of the city belonging to Hampden, Massachusetts?
Evidence: the county of Hampden is located in the state of Massachusetts.
SQL: 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
Database: address
Question: List the area code of the city with the highest Hispanic population.
Evidence: the highest Hispanic population refers to MAX(hispanic_population);
SQL: 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 )
Database: address
Question: Give the alias of the cities with an Asian population of 7.
Evidence: Asian population of 7 refers to asian_population = 7;
SQL: 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
Database: address
Question: What is the average of the white population in the cities with area code 920?
Evidence: AVG(white_population) where area_code = 920;
SQL: 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
Database: address
Question: Among the cities with alias Ponce, what is the percentage of cities with a country level FIPS code of less than 20?
Evidence: DIVIDE(COUNT(county_fips < 20), COUNT(county_fips)) as percentage where alias = 'Ponce';
SQL: 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'
Database: address
Question: List down the country of the cities with a population greater than 97% of the average population of all countries in 2020.
Evidence: population_2020 > MULTIPLY(0.97, AVG(population_2020));
SQL: 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 )
Database: address
Question: Count the number of postal points in the district represented by Kirkpatrick Ann.
Evidence: postal points refer to zip_code;
SQL: 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'
Database: address
Question: Provide the zip codes and coordinates of the postal points under Allentown-Bethlehem-Easton, PA-NJ.
Evidence: coordinates refer to latitude and longitude; under Allentown-Bethlehem-Easton, PA-NJ refers to CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ';
SQL: 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'
Database: address
Question: Provide the zip codes, cities, and locations of the postal points that have Shared Reshipper as a bad alias.
Evidence: latitude and longitude coordinates can be used to identify the location;
SQL: 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'
Database: address
Question: Who are the congress representatives of the postal points in Garfield?
Evidence: Who are the congress representatives refer to first_name, last_name; Garfield is the city;
SQL: 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'
Database: address
Question: Count the number of postal points under New York-Newark-Jersey City, NY-NJ-PA.
Evidence: postal points refer to zip_code; under New York-Newark-Jersey City, NY-NJ-PA refers to CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA';
SQL: 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'
Database: address
Question: How many postal points are there under the congress representative in Puerto Rico?
Evidence: postal points refer to zip_code; Puerto Rico refers to state = 'Puerto Rico';
SQL: 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'
Database: address
Question: Describe the number of postal points and the countries in West Virginia.
Evidence: postal points refer to zip_code; West Virginia is the name of the state, in which name = 'West Virginia';
SQL: 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'
Database: address
Question: Provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000.
Evidence: community post office type refers to type = 'Community Post Office'; elevation above 6000 refers to elevation > 6000;
SQL: 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
Database: address
Question: How many postal points are there under the congress representative from the House of Representatives in Mississippi?
Evidence: postal points refer to zip_code; Mississippi is the name of the state, in which name = 'Mississippi';
SQL: 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'
Database: address
Question: Provide the congress representatives' IDs of the postal points in East Springfield.
Evidence: congress representatives' IDs refer to CID; East Springfield is the city;
SQL: 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'
Database: address
Question: Who is the CBSA officer of the post point in the area with the highest number of employees?
Evidence: CBSA officer refers to CBSA_name; the highest number of employees refers to MAX(employees);
SQL: 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 )
Database: address
Question: How many postal points with unique post office types are there in Ohio?
Evidence: postal points refer to zip_code; unique post office types refer to type = 'Unique Post Office'; Ohio is the name of the state, in which name = 'Ohio';
SQL: 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'
Database: address
Question: Calculate the average number of beneficiaries per postal point in Guam.
Evidence: DIVIDE(SUM(total_beneficiaries), COUNT(zip_code)) where name = 'Guam';
SQL: 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'
Database: address
Question: Calculate the percentage of congress representatives from the Democrat party. Among them, how many postal points are in the Hawaii state?
Evidence: DIVIDE(COUNT(party = 'Democrat'), COUNT(congress_rep_id)) as percentage; postal points refer to zip_code; state = 'Hawaii';
SQL: 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
Database: beer_factory
Question: What is the name of the root beer brand that has the longest history?
Evidence: name of the root beer brand refers to BrandName; longest history refers to MIN(FirstBrewedYear);
SQL: SELECT BrandName FROM rootbeerbrand WHERE FirstBrewedYear = ( SELECT MIN(FirstBrewedYear) FROM rootbeerbrand )
Database: beer_factory
Question: How many breweries are located in North America?
Evidence: North America refers to country = 'United States'; North America is the name of continent where country = 'United States' is located;
SQL: SELECT COUNT(BrandID) FROM rootbeerbrand WHERE Country = 'United States'
Database: beer_factory
Question: Please list the names of all the root beer brands that are advertised on facebook.
Evidence: name of the root beer brand refers to BrandName; advertised on facebook refers to FacebookPage IS not NULL;
SQL: SELECT BrandName FROM rootbeerbrand WHERE FacebookPage IS NOT NULL
Database: beer_factory
Question: What is the name of the root beer brand with the lowest unit profit available to wholesalers?
Evidence: name of the root beer brand refers to BrandName; lowest unit profit available to wholesalers refers to MIN(SUBTRACT(CurrentRetailPrice, WholesaleCost));
SQL: SELECT BrandName FROM rootbeerbrand ORDER BY CurrentRetailPrice - WholesaleCost LIMIT 1
Database: beer_factory
Question: What is the description of the root beer brand A&W?
Evidence: A&W refers to BrandName = 'A&W';
SQL: SELECT Description FROM rootbeerbrand WHERE BrandName = 'A&W'
Database: beer_factory
Question: In which city is the brewery AJ Stephans Beverages located?
Evidence: AJ Stephans refers to BreweryName = 'AJ Stephans Beverages';
SQL: SELECT City FROM rootbeerbrand WHERE BreweryName = 'AJ Stephans Beverages'
Database: beer_factory
Question: How many transactions had Frank-Paul Santangelo made in July, 2014?
Evidence: in July, 2014 refers to SUBSTR(TransactionDate, 1, 4) = '2014' AND SUBSTR(TransactionDate, 6, 2) = '07';
SQL: 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'
Database: beer_factory
Question: Among the transactions made in July, 2014, how many of them were made by a male customer?
Evidence: in July, 2014 refers to SUBSTR(TransactionDate, 1, 4) = '2014' AND SUBSTR(TransactionDate, 6, 2) = '07'; male customer refers to Gender = 'M';
SQL: 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'
Database: beer_factory
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?
Evidence: users permit the company to send regular emails to them refers to subscribedtoemaillist = 'TRUE'; Visa card refers to creditcardtype = 'Visa'; in July, 2014 refers to SUBSTR(TransactionDate, 1, 4) = '2014' AND SUBSTR(TransactionDate, 6, 2) = '07';
SQL: 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'
Database: beer_factory
Question: What is the full name of the customer that had made the most transactions in August, 2014?
Evidence: full name = First, Last; made the most transactions refers to MAX(COUNT(TransactionID)); in August, 2014 refers to SUBSTR(TransactionDate, 1, 4) = '2014' AND SUBSTR(TransactionDate, 6, 2) = '08';
SQL: 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
Database: beer_factory
Question: Please list the brands of all the root beer that Frank-Paul Santangelo had purchased on 2014/7/7.
Evidence: brands of the root beer refers to BrandName; purchased on 2014/7/7 refers to transactiondate = '2014-07-07';
SQL: 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-07-07'
Database: beer_factory
Question: Of the 4 root beers that Frank-Paul Santangelo purchased on 2014/7/7, how many of them were in cans?
Evidence: on 2014/7/7 refers to transactiondate = '2014-07-07'; in cans refers to containertype = 'Can';
SQL: 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'