Chinastark/bird_dataset huggingface dataset:
Database: food_inspection_2
Question: Name the taverns that failed the inspection in January 2010.
Evidence: tavern refers to facility_type = 'Tavern'; failed the inspection refers to results = 'Fail'; in January 2010 refers to inspection_date like '2010-01%'
SQL: SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE strftime('%Y-%m', T2.inspection_date) = '2010-01' AND T2.results = 'Fail' AND T1.facility_type = 'TAVERN'
Database: food_inspection_2
Question: How many of the inspections with serious point levels have no fines?
Evidence: serious point level refers to point_level = 'Serious'; no fines refers to fine = 0
SQL: SELECT COUNT(DISTINCT T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.point_level = 'Serious ' AND T2.fine = 0
Database: food_inspection_2
Question: What is the establishment's name with an inspection category of No Smoking Regulations?
Evidence: establishment's name refers to dba_name; an inspection category of No Smoking Regulations refers to category = 'No Smoking Regulations'
SQL: SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T4.category = 'No Smoking Regulations'
Database: food_inspection_2
Question: What is the difference in the number of restaurants that passed and failed the canvass inspection type?
Evidence: canvass inspection type refers to inspection_type = 'Canvass'; restaurant refers to facility_type = 'Restaurant'; difference = subtract(count(inspection_id where results = 'Pass'), count(inspection_id where results = 'Fail'))
SQL: SELECT COUNT(CASE WHEN T2.results = 'Pass' THEN T1.license_no END) - COUNT(CASE WHEN T2.results = 'Fail' THEN T1.license_no END) AS diff FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'Canvass' AND T1.facility_type = 'Restaurant'
Database: food_inspection_2
Question: Among the establishments that failed the inspection in February 2010, list the names of the employees with a salary greater than 70% of the average salary of all employees.
Evidence: failed the inspection refers to results = 'Fail'; in January 2010 refers to inspection_date like '2010-01%'; name of employee refers to first_name, last_name; a salary greater than 70% of the average salary refers to salary > multiply(avg(salary), 0.7)
SQL: SELECT DISTINCT T1.employee_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Fail' AND strftime('%Y-%m', T2.inspection_date) = '2010-02' AND T1.salary > 0.7 * ( SELECT AVG(salary) FROM employee )
Database: food_inspection_2
Question: Among the establishments that paid a 500 fine, what is the percentage of restaurants?
Evidence: a 500 fine refers to fine = 500; restaurant refers to facility_type = 'Restaurant'; percentage = divide(count(license_no where facility_type = 'Restaurant'), count(license_no)) * 100% where fine = 500
SQL: SELECT CAST(COUNT(CASE WHEN T1.facility_type = 'Restaurant' THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.facility_type) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T3.fine = 500
Database: coinmarketcap
Question: Name the coin that has the highest market capitalization for all transactions in 2018.
Evidence: highest market capitalization refers to max(market_cap); in 2018 refers to year(date) = 2018
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date LIKE '2018%' AND T2.market_cap = ( SELECT MAX(market_cap) FROM historical WHERE STRFTIME('%Y', date) = '2018' )
Database: coinmarketcap
Question: What is the total value of Argentum coined traded in the past 24 hours on 2016/10/11.
Evidence: total value in the past 24 hours refers to volume_24h; on 11/10/16 refers to date = '2016-11-10'
SQL: SELECT T2.volume_24h FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Argentum' AND T2.date = '2016-10-11'
Database: coinmarketcap
Question: List the price for Zetacoin on 13/11/1 and the next 7 consecutive days. What is the average price for these 7 days?
Evidence: on 1/11/13 and the next 7 consecutive days refers to DATE BETWEEN '2013-11-01' AND '2013-11-07'; average price refers to AVG(price); Zetacoin refers to name = 'Zetacoin'
SQL: SELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07' UNION ALL SELECT AVG(T2.PRICE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07'
Database: coinmarketcap
Question: For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.
Evidence: in May 2013 refers to month(date) = 5 AND year(date) = 2013; time to achieve the highest price refers to time_high; time to achieve the lowest price refers to time_low; WRAP refers to name = 'WARP'
SQL: SELECT T2.time_high, T2.time_low, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'WARP' AND STRFTIME('%Y-%m', T2.date) = '2016-08'
Database: coinmarketcap
Question: State the transaction date whereby DigixDAO was transacted at the hightest price.
Evidence: the highest price refers to max(price); DigixDAO refers to name = 'DigixDAO'
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'DigixDAO' ORDER BY T2.price DESC LIMIT 1
Database: coinmarketcap
Question: Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price.
Evidence: the highest percentage price changed in 24 hours refers to max(percent_change_24h)
SQL: SELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical )
Database: coinmarketcap
Question: What is the average monthly circulating supply for Frozen in 2014.
Evidence: average monthly circulating supply = AVG(circulating_supply); in 2017 refers to date BETWEEN '2017-01-01' AND '2017-12-31'
SQL: SELECT CAST(SUM(T2.circulating_supply) AS REAL) / 12 FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Frozen' AND STRFTIME('%Y', T2.date) = '2014'
Database: coinmarketcap
Question: List all the inactive coins and state the last date of its transaction?
Evidence: the last date refers to max(date); inactive coins refers to status = 'inactive'
SQL: SELECT T1.NAME, MAX(T2.DATE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T1.status = 'inactive' ORDER BY T2.DATE DESC LIMIT 1
Database: coinmarketcap
Question: What was the price of 1 Bitcoin in 2016?
Evidence: 2016 refers to historical date where year(date) = 2016
SQL: SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' AND STRFTIME('%Y', T2.date) = '2016'
Database: coinmarketcap
Question: State the transaction date and the price when Bitcoin was bottomed?
Evidence: was bottomed refers to min(price)
SQL: SELECT T2.date, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.price LIMIT 1
Database: coinmarketcap
Question: For all coins with average price more than $1000. State the current status of the coin.
Evidence: average price more than $1000 refers to AVG(price)>1000
SQL: SELECT T1.status FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id GROUP BY T1.name HAVING AVG(T2.price) > 1000
Database: coinmarketcap
Question: Name the coin and date of transactions with the greatest decline in percent change in 1 hour.
Evidence: the greatest decline in percent change in 1 hour refers to max(percent_change_1h)
SQL: SELECT T1.name, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_1h = ( SELECT MIN(percent_change_1h) FROM historical )
Database: coinmarketcap
Question: Name the coin under the token category that gives the highest max profit.
Evidence: the highest max profit refers to max(subtract(high, low))
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.category = 'token' ORDER BY T2.high - T2.low DESC LIMIT 1
Database: coinmarketcap
Question: Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22.
Evidence: average percentage price changed from the previous 24 hours refers to AVG(percent_change_24h); on 15/5/2013 refers to DATE = '2013-04-15'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE
Database: coinmarketcap
Question: Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?
Evidence: ranked the first refers to cmc_rank = 1; on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.cmc_rank = 1
Database: coinmarketcap
Question: How much dollars was a Bitcoin worth on 2013/4/28 according to the coin market?
Evidence: worth refers to price; on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T2.market_cap FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: Which crytocurrency was not opened on 2013/5/3?
Evidence: not opened refers to open IS NULL; on 2013/5/3 refers to date = '2013-05-03'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-03' AND T2.open IS NULL
Database: coinmarketcap
Question: What was the price of Bitcoin when it closed at the end of the day on 2013/4/29?
Evidence: price when it closed refers to close; on 2013/4/29 refers to date = '2013-04-29'
SQL: SELECT T2.close FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: When did Bitcoin reach its highest price on 2013/4/29?
Evidence: time that a coin reaches its highest price refers to time_high; on 2013/4/29 refers to date = '2013-04-29'
SQL: SELECT T2.time_high FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: What was the max profit a user can make on Bitcoin on 2013/4/28?
Evidence: the max profit = subtract(high, low); on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T2.high - T2.low FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: What was the number of Bitcoins verifiably burned until 2013/4/28?
Evidence: the number of Bitcoins verifiably burned = max_supply - total_supply; 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T2.max_supply - T2.total_supply FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: Which crytocurrency was traded in the highest value on 2016/1/8?
Evidence: traded in the highest value refers to max(volume_24h); on 2016/1/8 refers to date = '2016-01-08'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2016-01-08' AND T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical WHERE date = '2016-01-08' )
Database: coinmarketcap
Question: Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28.
Evidence: a total amount of existence of over 10000000 refers to total_supply>10000000; on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.total_supply > 10000000
Database: coinmarketcap
Question: Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before?
Evidence: price increased refers to percent_change_7d>0; decreased refers percent_change_7d<0; on 2013/5/5 refers to date = '2013-05-05'
SQL: SELECT (CASE WHEN T2.percent_change_7d > 0 THEN 'INCREASED' ELSE 'DECREASED' END) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-05' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: Which crytocurrency had a bigger number of coins circulating in the market and in the general public's hands on 2013/4/28, Bitcoin or Litecoin?
Evidence: a bigger number of coins circulating in the market refers to max(circulating_supply); on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1
Database: coinmarketcap
Question: How much was a Bitcoin on 2013/4/28?
Evidence: how much refers to price; on 2013/4/28 refers to date = '2013-04-28'
SQL: SELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: What was the average price of a Bitcoin in the year 2013?
Evidence: average price refers SUM(price)/COUNT(named = 'Bitcoin'); in the year 2013 refers to year(date) = 2013
SQL: SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y', T2.date) = '2013' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: What was the percentage of the Bitcoins verifiably burned until 2018/4/28?
Evidence: the percentage of the Bitcoins verifiably burned = divide(subtract(SUM(max_supply), SUM(total_supply)),SUM(total_supply))*100%; until 2013/4/28 refers to date<'2013-04-08'
SQL: SELECT CAST((SUM(T2.max_supply) - SUM(T2.total_supply)) AS REAL) / SUM(T2.total_supply) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date < '2018-04-28' AND T1.name = 'Bitcoin'
Database: coinmarketcap
Question: Please list the names of coins that has been disappeared.
Evidence: has disappeared refers to status = 'extinct'
SQL: SELECT name FROM coins WHERE status = 'extinct'
Database: coinmarketcap
Question: How many coins were added in May 2013? Please list the names of coins.
Evidence: in May 2013 refers to year(date_added) = 2013 and month(date_added) = 5
SQL: SELECT COUNT(id) num FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05' UNION ALL SELECT name FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05'
Database: coinmarketcap
Question: List the names and symbols of the coins that were added on June 14, 2013.
Evidence: added on June 14, 2013 refers to date_added like '2013-06-14%'
SQL: SELECT name, symbol FROM coins WHERE date_added LIKE '2013-06-14%'
Database: coinmarketcap
Question: List the names of coins that cannot be traded in 2014.
Evidence: cannot be tracked refers to status = 'untracked'; in 2014 refers to year(date_added) = '2014'
SQL: SELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked'
Database: coinmarketcap
Question: Name the coins that have three tags.
Evidence: have three tags refers to length(tag_names)-length(replace(tag_names,',','')) = 2
SQL: SELECT name FROM coins WHERE LENGTH(tag_names) - LENGTH(replace(tag_names, ',', '')) = 2
Database: coinmarketcap
Question: What is the name of the coin with the highest price?
Evidence: the highest price refers to max(price)
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.price = ( SELECT MAX(price) FROM historical )
Database: coinmarketcap
Question: Please name the coin that ranked first among the coins traded on April 29, 2013.
Evidence: ranked first refers to cmc_rank = 1; on April 29, 2013 refers to date = '2013-04-29'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T2.cmc_rank = 1
Database: coinmarketcap
Question: When is the best time to purchase Bitcoin?
Evidence: lowest price refers to low; best time refers to date with the low;
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.low LIMIT 1
Database: coinmarketcap
Question: What is the name of the coin that creates the most total value in the past 24 hours?
Evidence: creates the most total value in the past 24 hours refers to max(volume_24h)
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical )
Database: coinmarketcap
Question: Name the coins that were not opened on May 2013.
Evidence: not opened refers to open IS NULL; on May 2013 refers to year(date) = 2019 AND month(date) = 5
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y-%m', T2.date) = '2013-05' AND T2.open IS NULL
Database: coinmarketcap
Question: When is the highest closed price of CHNCoin?
Evidence: the highest closed price refers to max(close)
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'CHNCoin' ORDER BY T2.close DESC LIMIT 1
Database: coinmarketcap
Question: When did Peercoin rank fifth?
Evidence: when refers to date; rank fifth refers to cmc_rank = 5
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Peercoin' AND T2.cmc_rank = 5
Database: coinmarketcap
Question: When is Devcoin most valuable in the market?
Evidence: when refers to date; most valuable refers to max(market_cap)
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Devcoin' ORDER BY T2.market_cap DESC LIMIT 1
Database: coinmarketcap
Question: List the names of the top five coins traded on January 1, 2014.
Evidence: the top five coins refers to cmc_rank< = 5; on January 1, 2014 refers to date = '2014-01-01'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2014-01-01' AND T2.cmc_rank <= 5
Database: coinmarketcap
Question: When was Lebowskis not opened?
Evidence: when refers to date; not opened refers to open IS NULL
SQL: SELECT DISTINCT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Lebowskis' AND (T2.open IS NULL OR T2.open = 0)
Database: coinmarketcap
Question: When is the highest price of Terracoin?
Evidence: when refers to date; the highest price refers to max(price)
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Terracoin' ORDER BY T2.price DESC LIMIT 1
Database: coinmarketcap
Question: How many times was Bytecoin traded in June 2013?
Evidence: in June 2013 refers to year(date) = 2013 AND month(date) = 6
SQL: SELECT COUNT(T2.coin_id) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bytecoin' AND STRFTIME('%Y-%m', T2.date) = '2013-06'
Database: coinmarketcap
Question: List the names of the coins above the average price on April 28, 2013.
Evidence: average price = divide(sum(price), count(name)); on April 28, 2013 refers to date = '2013-04-28'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2018-04-28' AND T2.price > ( SELECT AVG(price) FROM historical WHERE date = '2018-04-28' )
Database: coinmarketcap
Question: What's the percentage of coins that is higher than the price 1 hour ago in May 29,2013? List the names of these coins.
Evidence: percentage that is higher than the price 1 hour ago refers to percent_change_1h>0; in May 29,2013 refers to date = '2013-05-29'
SQL: SELECT T1.NAME FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T2.DATE = '2013-05-29' AND T2.percent_change_1h > 0
Database: retail_world
Question: How many employees have obtained a doctorate?
Evidence: doctorate refers to TitleOfCourtesy = 'Dr.;
SQL: SELECT COUNT(EmployeeID) FROM Employees WHERE TitleOfCourtesy = 'Dr.'
Database: retail_world
Question: To whom does Nancy Davolio report? Please give that employee's full name.
Evidence: to whom refers to ReportsTo; full name = FirstName, LastName;
SQL: SELECT FirstName, LastName FROM Employees WHERE EmployeeID = ( SELECT ReportsTo FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' )
Database: retail_world
Question: Which phone number should I call if I want to reach Nancy Davolio's home?
Evidence: phone number of Nancy Davolio's home refers to HomePhone WHERE FirstName = 'Nancy' AND LastName = 'Davolio';
SQL: SELECT HomePhone FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy'
Database: retail_world
Question: How many employees have Andrew Fuller as their direct supervisor?
Evidence: direct supervisor refers to ReportsTo where the person being reported to is usually the direct supervisor of the reporter;
SQL: SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' )
Database: retail_world
Question: Which employee has the highest salary? Please give his or her full name.
Evidence: highest salary refers to MAX(Salary); full name = FirstName, LastName;
SQL: SELECT FirstName, LastName FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
Database: retail_world
Question: How much higher is the salary of Andrew Fuller than that of Nancy Davolio?
Evidence: how much higher = SUBTRACT(SUM(Salary WHERE LastName = 'Fuller' and FirstName = 'Andrew'), SUM(Salary WHERE LastName = 'Davolio' and FirstName = 'Nancy'));
SQL: SELECT ( SELECT Salary FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' ) - ( SELECT Salary FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' ) AS RESULT
Database: retail_world
Question: Among the employees working as Sales Representatives, how many of them are located in the UK?
Evidence: Sales Representatives refers to Title = 'Sales Representative'; UK refers to Country = 'UK';
SQL: SELECT COUNT(Country) FROM Employees WHERE Title = 'Sales Representative' AND Country = 'UK'
Database: retail_world
Question: Which employee is in charge of the sales in Hollis? Please give the employee's full name.
Evidence: Hollis refers to TerritoryDescription = 'Hollis'; full name = FirstName, LastName;
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T3.TerritoryDescription = 'Hollis'
Database: retail_world
Question: The sales of how many territories is Nancy Davolio in charge of?
SQL: SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio'
Database: retail_world
Question: Please list the names of all the territories whose sales are taken in charge by Nancy Davolio.
Evidence: names of all territories refers to TerritoryDescription;
SQL: SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio'
Database: retail_world
Question: The sales of how many territories in total do the employees in London take charge of?
Evidence: London refers to city = 'London';
SQL: SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.City = 'London'