Chinastark/bird_dataset huggingface dataset:
Database: retail_world
Question: What is the description of the category that tofu belongs to?
Evidence: tofu is the name of the product;
SQL: SELECT T1.Description FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.ProductName = 'tofu'
Database: retail_world
Question: Which company supplies Gula Malacca?
Evidence: Gula Malacca is the name of the product; company refers to CompanyName;
SQL: SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Gula Malacca'
Database: retail_world
Question: What are the products that are supplied by Aux joyeux ecclsiastiques?
Evidence: Aux joyeux ecclsiastiques is the name of supply company; products refer to ProductName;
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Aux joyeux ecclsiastiques'
Database: retail_world
Question: How much per unit of Konbu does Mayumi's charge?
Evidence: Mayumi's is the name of the company; how much per unit of Konbu refers to UnitPrice where ProductName = 'Konbu';
SQL: SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'Mayumi%' AND T1.ProductName = 'Konbu'
Database: retail_world
Question: Who is the person to contact to get Camembert Pierrot?
Evidence: Camembert Pierrot is the name of the product; person to contact refers to ContactName;
SQL: SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Camembert Pierrot'
Database: retail_world
Question: Please name any three products that have been discontinued in the meat or poultry category.
Evidence: three products that have been discontinued refer to ProductName LIMIT 3 where Discontinued = 1; CategoryName = 'Meat/Poultry';
SQL: SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.Discontinued = 1 AND T1.CategoryName = 'Meat/Poultry' LIMIT 3
Database: retail_world
Question: Please name any two products that have the highest satisfaction levels among users of Heli Swaren GmbH & Co. KG.
Evidence: High reorder level generally means high user satisfaction; the highest satisfaction levels refer to MAX(ReorderLevel); two products refer to ProductName LIMIT 2; CompanyName = 'Heli Swaren GmbH & Co. KG';
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Heli Swaren GmbH & Co. KG' ORDER BY T1.ReorderLevel DESC LIMIT 2
Database: retail_world
Question: Who is the one representing the company "Heli Swaren GmbH & Co. KG"?
Evidence: Heli Swaren GmbH & Co. KG is the name of the company; who is representing refers to ContactName;
SQL: SELECT ContactName FROM Suppliers WHERE CompanyName = 'Heli Swaren GmbH & Co. KG'
Database: retail_world
Question: From which country is the company "Drachenblut Delikatessen" from?
Evidence: Drachenblut Delikatessen is the company name;
SQL: SELECT Country FROM Customers WHERE CompanyName = 'Drachenblut Delikatessen'
Database: retail_world
Question: How many territories are there?
SQL: SELECT COUNT(TerritoryID) FROM Territories
Database: retail_world
Question: What is the largest total price for an order?
Evidence: the largest total price for an order can be calculated as MAX(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1-Discount)));
SQL: SELECT SUM(UnitPrice) FROM `Order Details` GROUP BY OrderID ORDER BY SUM(UnitPrice) DESC LIMIT 1
Database: retail_world
Question: Which product is the most expensive?
Evidence: most expensive product refers to ProductName where MAX(UnitPrice);
SQL: SELECT ProductName FROM Products WHERE UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )
Database: retail_world
Question: How many of the orders are shipped to France?
Evidence: shipped to France refers to ShipCountry = 'France';
SQL: SELECT COUNT(ShipCountry) FROM Orders WHERE ShipCountry = 'France'
Database: retail_world
Question: Which region does Hoffman Estates belong to?
Evidence: Hoffman Estates refer to TerritoryDescription;
SQL: SELECT T2.RegionDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T1.TerritoryDescription = 'Hoffman Estates'
Database: retail_world
Question: What is the homepage link for the company that supplies the product "Thringer Rostbratwurst"?
Evidence: ProductName = 'Thringer Rostbratwurst';
SQL: SELECT T2.HomePage FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Thringer Rostbratwurst'
Database: retail_world
Question: List the first names of the employees who take the orders that ship to the city of "Reims".
Evidence: ship to the city of "Reims" refers to ShipCity = Reims';
SQL: SELECT DISTINCT T1.FirstName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.ShipCity = 'Reims'
Database: retail_world
Question: What is the largest quantity of "Manjimup Dried Apples" for an order?
Evidence: the largest quantity of "Manjimup Dried Apples" refers to MAX(Quantity) where ProductName = 'Manjimup Dried Apples';
SQL: SELECT T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T2.ProductID = T1.ProductID WHERE T1.ProductName = 'Manjimup Dried Apples' ORDER BY T2.Quantity DESC LIMIT 1
Database: retail_world
Question: How many orders were shipped by "Speedy Express"?
Evidence: "Speedy Express" is the name of the shipping company; orders refer to OrderID;
SQL: SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express'
Database: retail_world
Question: Make a list of all the territories in the Southern region.
Evidence: territories in the Southern region refer to TerritoryDescription WHERE RegionDescription = 'Southern';
SQL: SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern'
Database: retail_world
Question: What are the prices on cheese products?
Evidence: prices on cheese refer to UnitPrice WHERE Description = 'Cheeses';
SQL: SELECT T2.UnitPrice FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.Description = 'Cheeses'
Database: retail_world
Question: How many orders did "Laughing Bacchus Wine Cellars" make?
Evidence: "Laughing Bacchus Wine Cellars" is the name of the company; orders refer to OrderID;
SQL: SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'Laughing Bacchus Wine Cellars'
Database: retail_world
Question: List all the products that were shipped to Starenweg 5.
Evidence: products shipped to Starenweg 5 refer to ProductName where ShipAddress = 'Starenweg 5';
SQL: SELECT T3.ProductName FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.ShipAddress = 'Starenweg 5' GROUP BY T3.ProductName
Database: retail_world
Question: What are the products by the company "Bigfoot Breweries"?
Evidence: Bigfoot Breweries is the name of the company; products refer to ProductName;
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Bigfoot Breweries'
Database: retail_world
Question: What are the names of Robert King's territories?
Evidence: Robert King is a full name of an employee where LastName = 'King' AND FirstName = 'Robert'; names of territories refer 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.LastName = 'King' AND T1.FirstName = 'Robert'
Database: retail_world
Question: Provide the name of the contact person who made the orders that shipped to Switzerland.
Evidence: shipped to Switzerland refers to ShipCountry = 'Switzerland'; contact person refers to Customers;
SQL: SELECT T1.ContactName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.ShipCountry = 'Switzerland' GROUP BY T1.ContactName
Database: retail_world
Question: What proportion of orders are taken by the Sales Representative?
Evidence: DIVIDE(COUNT(OrderID where Title = 'Sales Representative'), COUNT(OrderID)) as percentage;
SQL: SELECT CAST(COUNT(CASE WHEN T1.Title = 'Sales Representative' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID
Database: retail_world
Question: Among the USA employess, how many of them has PhD title of courtesy?
Evidence: "USA" is the Country; PhD title of courtesy refers to TitleOfCourtesy = 'Dr.'
SQL: SELECT COUNT(Country) FROM Employees WHERE TitleOfCourtesy = 'Dr.' AND Country = 'USA'
Database: retail_world
Question: What is the average salary for employees from ID 1 to 9?
Evidence: ID 1 to 9 refers to EmployeeID BETWEEN 1 AND 9; Average salary = AVG(Salary)
SQL: SELECT AVG(Salary) FROM Employees WHERE EmployeeID BETWEEN 1 AND 9
Database: retail_world
Question: Calculate the total salary for employees from UK.
Evidence: "UK" is the Country; total salary refers to Sum(Salary)
SQL: SELECT SUM(Salary) FROM Employees WHERE Country = 'UK'
Database: retail_world
Question: Is (206) 555-1189 the home phone number for Laura Callahan?
Evidence: "Laura Callahan" refers to FirstName = 'Laura AND LastName = 'Callahan
SQL: SELECT CASE WHEN HomePhone = '(206) 555-1189' THEN 'YES' ELSE 'NO' END FROM Employees WHERE FirstName = 'Laura' AND LastName = 'Callahan'
Database: retail_world
Question: Write down the notes of employee with the highest salary.
Evidence: highest salary refers to Max(Salary)
SQL: SELECT Notes FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
Database: retail_world
Question: List down the customer ids who placed order with Michael Suyama.
SQL: SELECT T2.CustomerID FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Michael' AND T1.LastName = 'Suyama'
Database: retail_world
Question: Where are the ship countries of orders placed by Janet Leverling?
SQL: SELECT DISTINCT T2.ShipCountry FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Janet' AND T1.LastName = 'Leverling'
Database: retail_world
Question: How many orders have Margaret Peacock placed?
SQL: SELECT COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Margaret' AND T1.LastName = 'Peacock'
Database: retail_world
Question: Calculate the average salary per order for Andrew Fuller.
Evidence: average salary = AVG(Salary)
SQL: SELECT CAST(SUM(T1.Salary) AS REAL) / COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Andrew' AND T1.LastName = 'Fuller'
Database: retail_world
Question: What are the product names of Exotic Liquids?
Evidence: "Exotic Liquids" is the CompanyName
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
Database: retail_world
Question: List down the quantity per unit for products of Tokyo Traders.
Evidence: "Tokyo Traders" is the CompanyName
SQL: SELECT T1.QuantityPerUnit FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Tokyo Traders'
Database: retail_world
Question: How many products have been discountinued by New Orleans Cajun Delights?
Evidence: "New Orleans Cajun Delights" is the CompanyName; discontinued refers to Discontinued = 1
SQL: SELECT COUNT(T1.Discontinued) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'New Orleans Cajun Delights'
Database: retail_world
Question: Please calculate the average unit price for products of Formaggi Fortini s.r.l.
Evidence: "Formaggi Fortini s.r.l." is the CompanyName; average unit price = AVG(UnitPrice)
SQL: SELECT SUM(T1.UnitPrice) / COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Formaggi Fortini s.r.l.'
Database: retail_world
Question: Calculate the total products that are supplied by Japan suppliers.
Evidence: Japan Supplier refers to Country = 'Japan'; total product refers to Count (ProductName)
SQL: SELECT COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'
Database: retail_world
Question: What is the contact name for product Teatime Chocolate Biscuits?
Evidence: "Teatime Chocolate Biscuits" is the ProductName
SQL: SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Teatime Chocolate Biscuits'
Database: retail_world
Question: List down the company names that have the highest reorder level.
Evidence: Highest reorder level refers to Max(ReorderLevel)
SQL: SELECT DISTINCT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )
Database: retail_world
Question: What is the contact title for the person who supplied a product that is 10 boxes x 12 pieces.
Evidence: "10 boxes x 12 pieces" is the QuantityPerUnit
SQL: SELECT T2.ContactTitle FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.QuantityPerUnit = '10 boxes x 12 pieces'
Database: retail_world
Question: What is the total units on order from Exotic Liquids?
Evidence: "Exotic Liquids" is the CompanyName; total unit on order = Sum(UnitsOnOrder)
SQL: SELECT SUM(T1.UnitsOnOrder) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
Database: retail_world
Question: Calculate the percentage of products supplied by Gai pturage over all products.
Evidence: "Gai pturage" is the CompanyName; Percentage = Divide (Count(SupplierID where CompanyName = 'Gai pturage'), Count (SupplierID)) * 100
SQL: SELECT CAST(COUNT(CASE WHEN T2.CompanyName = 'Gai pturage' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID
Database: retail_world
Question: List the product ID of the top five products, by descending order, the number of quantities in stock.
Evidence: by descending in number of quantity in stock refers to max(UnitsInStock)
SQL: SELECT ProductID FROM Products ORDER BY UnitsInStock DESC LIMIT 5
Database: retail_world
Question: Among the products, how many of them were discontinued in production?
Evidence: discontinued refers to Discontinued = 1
SQL: SELECT COUNT(*) FROM Products WHERE Discontinued = 1
Database: retail_world
Question: Give me the address, home phone and salary of the Sales Manager.
Evidence: "Sales Manage" is the Title
SQL: SELECT Address, HomePhone, Salary FROM Employees WHERE Title = 'Sales Manager'
Database: retail_world
Question: What is the full name of the Vice President of Sales. Give me the URL of his/her photo.
Evidence: "Vice Present of Sales" refers to Title = 'Vice President, Sales'; full name refers to FirstName, LastName; url of photo refers to PhotoPath
SQL: SELECT FirstName, LastName FROM Employees WHERE Title = 'Vice President, Sales'
Database: retail_world
Question: Write down the top ten companies with the most total sales by amount.
Evidence: most total sales refers to Max(SaleAmount); companies refers to CompanyName
SQL: SELECT CompanyName FROM `Sales Totals by Amount` ORDER BY SaleAmount DESC LIMIT 10
Database: retail_world
Question: What is the average sales for each categories?
Evidence: average sales = AVG(ProductSales)
SQL: SELECT AVG(ProductSales) FROM `Sales by Category` GROUP BY CategoryName
Database: retail_world
Question: Compute the total order quantity for Uncle Bob's Organic Dried Pears so far.
Evidence: "Uncle Bob's Organic Dried Pears" is the ProductName; total order quantity refers to Sum(Quantity)
SQL: SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName LIKE 'Uncle Bob%s Organic Dried Pears'
Database: retail_world
Question: Among the seafoods, how many of them have an order quantity of more than 50?
Evidence: "Seafood" is the CategoryName; order quantity of more than 50 refers to Quantity > 50
SQL: SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Categories AS T3 ON T1.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Seafood' AND T2.Quantity > 50
Database: retail_world
Question: List the products whose supplier is Pavlova, Ltd. Please include the product ID and re-order level.
Evidence: "Pavlova, Ltd" is the CompanyName; products refers to ProductName
SQL: SELECT T1.ProductName, T1.ProductID, T1.ReorderLevel FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Pavlova, Ltd.'
Database: retail_world
Question: Who are the suppliers of the discontinued products?
Evidence: discontinued product refers to Discontinued = 1; supplier refers to CompanyName
SQL: SELECT DISTINCT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.Discontinued = 1
Database: retail_world
Question: Among the employees, give me the full names of those who have less than 4 territories.
Evidence: less than 4 territories refers to EmployeeID where Count(TerritoryID) < 4
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.EmployeeID < 4
Database: retail_world
Question: How many employees have territories in the Eastern region?
Evidence: "Eastern" is the RegionDescription
SQL: SELECT COUNT(DISTINCT T1.FirstName) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Eastern'
Database: retail_world
Question: From 1/3/97 to 8/10/97, how many orders were shipped via Federal Shipping?
Evidence: from 1/3/97 to 8/10/97 refers to 1997-03-01 < ShippedDate < 1997-10-08; 'Federal Shipping' is the CompanyName
SQL: SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping' AND T1.ShippedDate BETWEEN '1997-03-01 00:00:00' AND '1997-10-08 23:59:59'
Database: retail_world
Question: Tally the customer ID of orders that were shipped to Brazil by Margaret Peacock from 3/31/97 to 12/10/97.
Evidence: "Brazil" is the ShipCountry; from 3/31/97 to 12/10/97 refers to 1997-03-31 < ShippedDate < 1997-10-12
SQL: SELECT DISTINCT T2.CustomerID FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.LastName = 'Peacock' AND T1.FirstName = 'Margaret' AND T2.ShipCountry = 'Brazil' AND T2.ShippedDate BETWEEN '1997-03-31 00:00:00' AND '1997-12-10 23:59:59'
Database: retail_world
Question: What is the re-order level of products that have an order quantity of 1?
Evidence: order quantity of 1 refers to Quantity = 1
SQL: SELECT T1.ReorderLevel FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity = 1
Database: retail_world
Question: What is the stock value of every condiments?
Evidence: "Condiments" is the CategoryName; Stock value = MULTIPLY( UnitPrice, UnitInStock)
SQL: SELECT T1.UnitPrice * T1.UnitsInStock FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID
Database: retail_world
Question: How many territories are owned by Anne Dodsworth?
SQL: SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Anne' AND T1.LastName = 'Dodsworth'
Database: retail_world
Question: Which of the American customers have experienced a delay in the shipment and how long was the longest?
Evidence: "American" refers to Country = 'USA'; longest delay in shipment refers to Max(Subtract(RequiredDate, ShippedDate)); customer refers to CustomerID
SQL: SELECT T1.CompanyName, TIMESTAMPDIFF(DAY, T2.ShippedDate, T2.RequiredDate) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Country = 'USA' AND TIMESTAMPDIFF(DAY, T2.ShippedDate, T2.RequiredDate) < 0
Database: retail_world
Question: What is the contact name and phone number of the customer who has made the most total payment on the order to date?
Evidence: most total payment = Max(Multiply(Quantity, UnitPrice, Subtract(1, Discount)))
SQL: SELECT T1.ContactName, T1.Phone FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID GROUP BY T2.OrderID, T1.ContactName, T1.Phone ORDER BY SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) DESC LIMIT 1
Database: retail_world
Question: Who is the sales representative of the customer who has made the highest payment? Include the full name of employee and his/her supervisor.
Evidence: highest payment refers to Max(Multiply(Quantity, UnitPrice, Subtract(1, Discount))); full name refers to FirstName, LastName; his/her supervisor refers to 'ReportsTo'
SQL: SELECT T4.LastName, T4.FirstName, T4.ReportsTo , T1.Quantity * T1.UnitPrice * (1 - T1.Discount) AS payment FROM `Order Details` AS T1 INNER JOIN Orders AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID INNER JOIN Employees AS T4 ON T2.EmployeeID = T4.EmployeeID ORDER BY payment DESC LIMIT 1
Database: retail_world
Question: How many customers are there in Berlin, Germany?
Evidence: "Berlin" is the City; 'Germany' is the Country
SQL: SELECT COUNT(City) FROM Customers WHERE Country = 'Germany' AND City = 'Berlin'
Database: retail_world
Question: How many products does the company Exotic Liquids supply?
Evidence: "Exotic Liquids" is the CompanyName of supplier
SQL: SELECT COUNT(T1.ProductName) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
Database: retail_world
Question: Which company has the lowest unit price? Please give the company name and the product name.
Evidence: lowest unit price refers to Min(UnitPrice)
SQL: SELECT T2.CompanyName, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MIN(UnitPrice) FROM Products )
Database: retail_world
Question: What is the average unit price of Tokyo Traders' products?
Evidence: "Tokyo Traders" is the CompanyName; average unit price = AVG(UnitPrice)
SQL: SELECT SUM(T1.UnitPrice) / COUNT(T2.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Tokyo Traders'
Database: retail_world
Question: How many territories are there in the Eastern region?
Evidence: "Eastern" is the RegionDescription
SQL: SELECT COUNT(T1.RegionID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
Database: retail_world
Question: Which region has the most territories?
Evidence: region refers to RegionDescription; most territories refers to Max(Count(TerritoryID))
SQL: SELECT T2.RegionID FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID GROUP BY T2.RegionID ORDER BY COUNT(T1.TerritoryID) DESC LIMIT 1
Database: retail_world
Question: Which region does territory id 2116 belong to?
Evidence: region refers to RegionDescription
SQL: SELECT T2.RegionDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T1.TerritoryID = 2116