1sf/bird-sql-train-with-schema huggingface dataset:
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the price and quantity of the product named Seat Tube?
SQL: SELECT DISTINCT T2.Price, T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Seat Tube'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the price and name of the product bought by Erica Xu?
SQL: SELECT T3.Price, T3.Name FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.FirstName = 'Erica' AND T2.LastName = 'Xu'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the sales ID of the product with a quantity of 590 and named "External Lock Washer 7".
Evidence: External Lock Washer 7' is name of product;
SQL: SELECT T1.SalesID FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'External Lock Washer 7' AND T1.Quantity = 590
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: In sales ID between 30 and 40, who is the customer that bought a total quantity of 403?
Evidence: who refers to FirstName, LastName;
SQL: SELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity = 403 AND T1.SalesID BETWEEN 30 AND 40
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: List the customer's ID and last name of the customer that purchased a product with a quantity greater than 90% of the average quantity of all listed products.
Evidence: quantity greater than 90% of the average quantity = Quantity > MULTIPLY(AVG(Quantity), 0.9);
SQL: SELECT T2.CustomerID, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity > ( SELECT AVG(Quantity) FROM Sales ) * 0.9
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: Among the sales ID ranges from 1 to 200, what is the percentage of the products with a price ranging from 200 to 300?
Evidence: sales ID ranges from 1 to 200 refers to SalesID between 1 and 200; percentage = MULTIPLY(DIVIDE(SUM(Price between 200 and 300), COUNT(Price)), 1.0);
SQL: SELECT CAST(SUM(IIF(T2.Price BETWEEN 200 AND 300, 1, 0)) AS REAL) * 100 / COUNT(T2.Price) FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.SalesID BETWEEN 1 AND 200
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the name of the most expensive product?
Evidence: most expensive product refers to MAX(Price);
SQL: SELECT Name FROM Products WHERE Price = ( SELECT MAX(Price) FROM Products )
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many customers are named Madison?
SQL: SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Madison'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many types of "HL Touring Frames" are there?
Evidence: types of HL Touring Frames refers to Name like '%HL Touring Frame%';
SQL: SELECT COUNT(ProductID) FROM Products WHERE Name LIKE '%HL Touring Frame%'
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many customers share the most common last name?
Evidence: most common last name refers to MAX(COUNT(LastName));
SQL: SELECT COUNT(CustomerID) FROM Customers GROUP BY LastName ORDER BY COUNT(LastName) DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: How many free or gift products are there?
Evidence: free gift refers to Price = 0;
SQL: SELECT COUNT(ProductID) FROM Products WHERE Price = 0
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the name of the sales person who handled the highest number of sales?
Evidence: name of the sales person = FirstName, MiddleInitial, LastName; highest number of sales refers to MAX(COUNT(SalesID));
SQL: SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T2.SalesPersonID = T1.EmployeeID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 1
Database: sales
Tables: Customers, Employees, Products, Sales
Columns (table index, column name): -1, *, 0, CustomerID, 0, FirstName, 0, MiddleInitial, 0, LastName, 1, EmployeeID, 1, FirstName, 1, MiddleInitial, 1, LastName, 2, ProductID, 2, Name, 2, Price, 3, SalesID, 3, SalesPersonID, 3, CustomerID, 3, ProductID, 3, Quantity
Question: What is the full name of the customer who purchased the highest amount of total price in a single purchase?
Evidence: full name of the customer = FirstName, MiddleInitial, LastName; highest amount of total price refers to MAX(MULTIPLY(Quantity, Price));
SQL: SELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T1.ProductID = T3.ProductID GROUP BY T1.SalesID, T1.Quantity, T3.Price, FirstName, MiddleInitial, LastName ORDER BY T1.Quantity * T3.Price DESC LIMIT 1
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: What is the percentage of female customers who subscribed to the email list?
Evidence: percentage = MULTIPLY(DIVIDE(COUNT(CustomerID WHERE Gender = 'F'), COUNT(CustomerID) WHERE SubscribedToEmailList = 'TRUE'), 1.0); female refers to Gender = 'F'; subscribed to the email list refers to SubscribedToEmailList = 'TRUE';
SQL: SELECT CAST(COUNT(CASE WHEN Gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(SubscribedToEmailList) FROM customers WHERE SubscribedToEmailList = 'TRUE'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: Which type of card did Dick Ruthven use to pay for all of his transactions?
Evidence: type of card refers to CreditCardType;
SQL: SELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Dick' AND T1.Last = 'Ruthven'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: How many transactions were made at Sac State Union?
Evidence: Sac State Union refers to LocationName = 'Sac State Union';
SQL: SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State Union'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: How many stars did Urijah Faber rate for Frostie?
Evidence: stars refers to StarRating; Frostie refers to BrandName = 'Frostie';
SQL: SELECT T2.StarRating 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 = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: Which brand has the lowest star rating with a "Too spicy!" review?
Evidence: lowest star rating refers to MIN(StarRating); "Too spicy!" review refers to Review = 'Too Spicy!';
SQL: SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 AND T2.Review = 'Too Spicy!'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: How many purchases were made at Sac State American River Courtyard using Master Card?
Evidence: Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard'; Master Card refers to CreditCardType = 'MasterCard';
SQL: SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State American River Courtyard' AND T1.CreditCardType = 'MasterCard'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: Which brand in 2012 has the lowest star rating and contains cane sugar as well as honey?
Evidence: brand refers to BrandName; in 2012 refers to ReviewDate LIKE '2012%'; lowest star rating refers to MIN(StarRating); contains cane sugar as well as honey refers to CaneSugar = 'TRUE' AND Honey = 'TRUE';
SQL: SELECT DISTINCT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.CaneSugar = 'TRUE' AND T1.Honey = 'TRUE' AND T2.StarRating = 1 AND T2.ReviewDate LIKE '2012%'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: What is the precise location of the place where Tommy Kono made a purchase in 2014?
Evidence: precise location = Latitude, Longitude; in 2014 refers to TransactionDate LIKE '2014%';
SQL: SELECT DISTINCT T1.Latitude, T1.Longitude FROM geolocation AS T1 INNER JOIN `transaction` AS T2 ON T2.LocationID = T1.LocationID INNER JOIN customers AS T3 ON T3.CustomerID = T2.CustomerID WHERE T3.First = 'Tommy' AND T3.Last = 'Kono' AND T2.TransactionDate LIKE '2014%'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: What is the email address of the customer who made a purchase in transaction 100016?
Evidence: email address refers to Email; transaction 100016 refers to TransactionID = 100016;
SQL: SELECT T1.Email FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.TransactionID = '100016'
Database: beer_factory
Tables: customers, geolocation, location, rootbeerbrand, rootbeer, rootbeerreview, transaction
Columns (table index, column name): -1, *, 0, CustomerID, 0, First, 0, Last, 0, StreetAddress, 0, City, 0, State, 0, ZipCode, 0, Email, 0, PhoneNumber, 0, FirstPurchaseDate, 0, SubscribedToEmailList, 0, Gender, 1, LocationID, 1, Latitude, 1, Longitude, 2, LocationID, 2, LocationName, 2, StreetAddress, 2, City, 2, State, 2, ZipCode, 3, BrandID, 3, BrandName, 3, FirstBrewedYear, 3, BreweryName, 3, City, 3, State, 3, Country, 3, Description, 3, CaneSugar, 3, CornSyrup, 3, Honey, 3, ArtificialSweetener, 3, Caffeinated, 3, Alcoholic, 3, AvailableInCans, 3, AvailableInBottles, 3, AvailableInKegs, 3, Website, 3, FacebookPage, 3, Twitter, 3, WholesaleCost, 3, CurrentRetailPrice, 4, RootBeerID, 4, BrandID, 4, ContainerType, 4, LocationID, 4, PurchaseDate, 5, CustomerID, 5, BrandID, 5, StarRating, 5, ReviewDate, 5, Review, 6, TransactionID, 6, CreditCardNumber, 6, CustomerID, 6, TransactionDate, 6, CreditCardType, 6, LocationID, 6, RootBeerID, 6, PurchasePrice
Question: How many transactions were made to purchase a bottle of beer using American Express?
Evidence: bottle of beer refers to ContainerType = 'Bottle'; American Express refers to CreditCardType = 'American Express';
SQL: SELECT COUNT(T1.RootBeerID) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID WHERE T1.ContainerType = 'Bottle' AND T2.CreditCardType = 'American Express'