1sf/bird-sql-train-with-schema huggingface dataset:
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: What are the names of the top 3 customers who paid the highest amount of price per order after discount?
Evidence: highest price per order after discount refers to Max(Subtract(Multiply (Unit Price, Order Quantity), Discount Applied)); name of customer refers to Customer Names
SQL: SELECT `Customer Names` FROM ( SELECT T1.`Customer Names` , REPLACE(T2.`Unit Price`, ',', '') * T2.`Order Quantity` - REPLACE(T2.`Unit Price`, ',', '') * T2.`Discount Applied` AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY T DESC LIMIT 3
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: Which sales channel was most preferred in commercializing products in January 2020 based on the number of orders placed?
Evidence: order refers to OrderDate; in 2020 refers to Substr(OrderDate, -2) = '20'; January refers to Substr(OrderDate, 1, 1) = '1';  most preferred sales channel refers to Sales Channel where Max(Count(OrderNumber))
SQL: SELECT `Sales Channel` FROM `Sales Orders` WHERE OrderDate LIKE '1/%/20' GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: Name the product that was registered in the sales order 'SO - 0005951'.
Evidence: sales order 'SO - 0005951' refers to OrderNumber = 'SO - 0005951'; product refers to Product Name
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: Identify the store location and sales team who processed the sales order 'SO - 0001004'.
Evidence: sales order 'SO - 0001004' refers to OrderNumber = 'SO - 0001004'; store location refers to City Name
SQL: SELECT T3.`Sales Team`, T1.`City Name` FROM `Store Locations` AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.OrderNumber = 'SO - 0001004'
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: Identify the top customer of the store located in Gilbert, Arizona based on net profit associated with the customer relationship in 2019.
Evidence: "Gilbert" is the City Name; 'Arizona' is the name of State; customer relationship in 2019 refers to ProcuredDate LIKE '%/19'; top net profit refers to Max(Subtract(Unit Price, Unit Cost))
SQL: SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Gilbert' AND T2.ProcuredDate LIKE '%/%/19' ORDER BY REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', '') DESC LIMIT 1
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: How many sales orders were processed by the store located in Chandler in 2020?
Evidence: "Chandler" is the City Name; orders refers to OrderDate; in 2020 refers to Substr(OrderDate, -2) = '20'
SQL: SELECT SUM(CASE WHEN T2.`City Name` = 'Chandler' AND T1.OrderDate LIKE '%/%/20' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: What is the average household income of Glendale?
Evidence: "Glendale" is the City Name; Average household income refers to avg(Household Income)
SQL: SELECT AVG(`Household Income`) FROM `Store Locations` WHERE `City Name` = 'Glendale'
Database: regional_sales
Tables: Customers, Products, Regions, Sales Team, Store Locations, Sales Orders
Columns (table index, column name): -1, *, 0, CustomerID, 0, Customer Names, 1, ProductID, 1, Product Name, 2, StateCode, 2, State, 2, Region, 3, SalesTeamID, 3, Sales Team, 3, Region, 4, StoreID, 4, City Name, 4, County, 4, StateCode, 4, State, 4, Type, 4, Latitude, 4, Longitude, 4, AreaCode, 4, Population, 4, Household Income, 4, Median Income, 4, Land Area, 4, Water Area, 4, Time Zone, 5, OrderNumber, 5, Sales Channel, 5, WarehouseCode, 5, ProcuredDate, 5, OrderDate, 5, ShipDate, 5, DeliveryDate, 5, CurrencyCode, 5, _SalesTeamID, 5, _CustomerID, 5, _StoreID, 5, _ProductID, 5, Order Quantity, 5, Discount Applied, 5, Unit Price, 5, Unit Cost
Question: What was the best discount applied to sales orders in 2020?
Evidence: sales orders in 2020 refers to Substr(OrderDate, -2) = '20'; best discount applied refers to Max(Discount Applied)
SQL: SELECT MAX(`Discount Applied`) FROM `Sales Orders` WHERE OrderDate LIKE '%/%/20'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the most consecutive games tied by Ebbsfleet as an away team in the 2008 season?
Evidence: consecutive games mean happen one after the other without interruption and refer to Date; tied refers to FTR = 'D';
SQL: SELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Of all the divisions in the world, what percentage of them belong to England?
Evidence: DIVIDE(COUNT(division where country = 'England'), COUNT(division)) as percentage;
SQL: SELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What percentage of games won, games lost and games drawn does Cittadella have as a home team in total?
Evidence: Percentage of games won = DIVIDE(COUNT(FTR = 'H' where HomeTeam = 'Cittadella'), COUNT(Div where HomeTeam = 'Cittadella')) as percentage; Percentage of games lost = DIVIDE(COUNT(FTR = 'A' where HomeTeam = 'Cittadella')), COUNT(Div where HomeTeam = 'Cittadella') as percentage; percentage of games drawn = DIVIDE(SUM(FTR = 'D'where HomeTeam = 'Cittadella'), COUNT(Div where HomeTeam = 'Cittadella')) as percentage;

SQL: SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Of all the teams that played as a team away against Caen in the 2010 season, which one has the highest winning percentage?
Evidence: Caen refers to HomeTeam; which one refers to AwayTeam; the highest winning percentage = MAX(DIVIDE(COUNT(FTR = 'A' where HomeTeam = 'Caen', season = '2010')), COUNT(Div where HomeTeam = 'Caen', season = '2010')) as percentage;
SQL: SELECT AwayTeam FROM matchs WHERE HomeTeam = 'Caen' AND season = 2010 AND FTR = 'A' GROUP BY AwayTeam ORDER BY COUNT(AwayTeam) DESC LIMIT 1
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What percentage of matches played on 2005/07/30 belong to the F1 division?
Evidence: Division refers to Div; DIVIDE(COUNT(Div = 'F1', Date = '2005/07/30'), COUNT(Div, Date = '2005/07/30')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN Div = 'F1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Div) FROM matchs WHERE Date = '2005-07-30'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What percentage of all tied games did the Sassuolo team play in?
Evidence: tied games refer FTR = 'D'; DIVIDE(COUNT(Div where FTR = 'D', HomeTeam = 'Sassuolo' or AwayTeam = 'Sassuolo'), COUNT(Div where HomeTeam = 'Sassuolo' or AwayTeam = 'Sassuolo')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the percentage whereby the away team scored 2 goals during the 2017 seasons?
Evidence: scored 2 goals refers to FTAG = 2, which is short name for Final-time Away-team Goals; DIVIDE(COUNT(Div where season = 2017, FTAG = '2'), COUNT(Div where season = 2017)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the name of all the teams that played in the EFL League One division?
Evidence: all the teams include both HomeTeam and AwayTeam; name = 'EFL League One'; DIV = 'E2';
SQL: SELECT T1.HomeTeam,T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'EFL League One' and T1.Div = 'E2'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: How many teams playing in divisions in Greece have ever scored 4 or more goals?
Evidence: teams include both HomeTeam and AwayTeam; country = 'Greece'; scored 4 or more goals refer to FTAG≥4, which is short name for Final-time Away-team Goals;
SQL: SELECT COUNT(DISTINCT CASE WHEN T1.FTHG >= 4 THEN HomeTeam ELSE NULL end) + COUNT(DISTINCT CASE WHEN T1.FTAG >= 4 THEN AwayTeam ELSE NULL end) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: How many matches played in the 2019 season of Scottish Championship league were ended with an equal result of 2-2?
Evidence: matches refer to Div; Scottish Championship is a name of the league; equal result of 2-2 refers to FTAG = 2 AND FTHG = 2;
SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons?
Evidence: local team refers to HomeTeam; Scottish means belong to the country = 'Scotland'; scored 10 goals refer to FTHG = 10, which is short name for Final-time Away-team Goals;
SQL: SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: From the Spanish LaLiga division in the 2017 season, which team won the most times as a local team and by what percentage?
Evidence: local team refers to HomeTeam; Spanish means belong to the country = 'Spain'; LaLiga is a name of division; won as a local team refers to FTR = 'H', where H stands for home victory; DIVIDE(COUNT(Div where name = 'LaLiga', country = 'Spain', season = 2017, FRT = 'H'), COUNT(Div where name = 'LaLiga', country = 'Spain', season = 2017)) as percentage;
SQL: SELECT T1.HomeTeam HWHT , CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T2.country = 'Spain' AND T1.season = 2017
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: How many teams that played in the 2012 season belong to any of the English divisions and what percentage play in each of the divisions?
Evidence: matches = Div
SQL: SELECT ( SELECT COUNT(T1.Div) AS total FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS num , CASE WHEN 1 THEN T.result END AS percentage FROM ( SELECT 100.0 * COUNT(T1.Div) / ( SELECT COUNT(T1.Div) FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS result FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 GROUP BY T2.division ) AS T
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the highest final-time score across all divisions in the 2021 season? Which team was the team that made up that score?
Evidence: MAX(SUM where FTHG, FTAG, season = 2021);
SQL: SELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the name of the home team in division P1 with the highest final time goal in all seasons?
Evidence: the highest final time goal refers to MAX(FTHG); P1 = Div;
SQL: SELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What was the difference in home team and away team win percentages across all divisions in 2010?
Evidence: 2010 refers to season = 2010; SUBTRACT(DIVIDE(COUNT(Div where FTR = 'H', season = 2010), COUNT(Div where season = 2010)), COUNT(Div where FTR = 'A', season = 2010), COUNT(Div where season = 2010)) as percentage;
SQL: SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Which division had the most draft matches in the 2008 season?
Evidence: the most draft matches refer to MAX(COUNT(Div)) where FTR = 'D';
SQL: SELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Which team won the match in the EC division on January 20, 2008 at home?
Evidence: won at home refers to FTR = 'H'; January 20, 2008 refers to Date = '2008-01-20'; EC division refers to Div = 'EC';
SQL: SELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: What is the name of the division in which Club Brugge and Genk competed on September 13, 2009?
Evidence: September 13, 2009 refers to Date = '2009-09-13'; Club Brugge refers to HomeTeam; Genk refers to AwayTeam;
SQL: SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: How many matches were played in the Scottish Premiership division from 2006 to 2008?
Evidence: Scottish Premiership is a name of division; from 2006 to 2008 means seasons between 2006 and 2008;
SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008)
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: In which division was the match between Hibernian, the away team, and Hearts, the home team, played? To which country does this division belong?
Evidence: FALSE;
SQL: SELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian'
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Which away team in the division of Bundesliga has the highest final time goals?
Evidence: Bundesliga is a name of division; the highest final time goals refers to MAX(FTAG);
SQL: SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1
Database: european_football_1
Tables: divisions, matchs
Columns (table index, column name): -1, *, 0, division, 0, name, 0, country, 1, Div, 1, Date, 1, HomeTeam, 1, AwayTeam, 1, FTHG, 1, FTAG, 1, FTR, 1, season
Question: Please provide the names of any three away teams that competed in the Italian divisions.
Evidence: Italian means belong to country = 'Italy";
SQL: SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3