Chinastark/bird_dataset huggingface dataset:
Database: retail_world
Question: What percentage of orders were placed by customers in Madrid city in 1996?
Evidence: "Madrid" is the City; in 1996 refers to YEAR (OrderDate) = 1996; percentage = Divide (Count (CustomerID where City = 'Madrid'), Count (CustomerID)) * 100
SQL: SELECT CAST(COUNT(CASE WHEN T1.City = 'Madrid' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.City) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = 1996
Database: retail_world
Question: Please list the full names and titles of all employees.
Evidence: full name refers to LastName, FirstName
SQL: SELECT FirstName, LastName, Title FROM Employees
Database: retail_world
Question: Who has the highest salary? Please give their first name.
Evidence: highest salary refers to Max(Salary)
SQL: SELECT FirstName, LastName FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
Database: retail_world
Question: How many sales representatives whose salaries are higher than 2000?
Evidence: "Sales Representative" is the Title; higher than 2000 refers to Salary > 2000
SQL: SELECT COUNT(Title) FROM Employees WHERE Salary > 2000 AND Title = 'Sales Representative'
Database: retail_world
Question: In 1996, how many orders were from customers in the UK?
Evidence: in 1996 refers to YEAR (OrderDate) = 1996; 'UK' is the Country;
SQL: SELECT COUNT(T1.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' AND T1.Country = 'UK'
Database: retail_world
Question: Which company had the most orders in 1998?
Evidence: in 1998 refers to YEAR (OrderDate) = 1998; most orders = Max(Count(CustomerID)); company refers to CompanyName
SQL: SELECT T1.CompanyName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1998' GROUP BY T1.CompanyName ORDER BY COUNT(T2.OrderID) DESC LIMIT 1
Database: retail_world
Question: Please calculate the number of orders from customers by country in 1996.
Evidence: in 1996 refer to YEAR(OrderDate) = 1996; number of order = Count(OrderID)
SQL: SELECT COUNT(T2.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' GROUP BY T1.Country
Database: retail_world
Question: How many orders were from Hanna Moos company in 1999?
Evidence: "Hanna Moos" is the CompanyName; in 1999 refer to YEAR (OrderDate) = 1999
SQL: SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1999' AND T1.CompanyName = 'Hanna Moos'
Database: retail_world
Question: How many days was the fastest shipping of Berglunds snabbkp's order?
Evidence: Berglunds snabbkp is the CompanyName; fastest shipping = Min(Subtract(ShippedDate, OrderDate))
SQL: SELECT datediff(T2.ShippedDate, T2.OrderDate) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'Berglunds snabbkp' ORDER BY datediff(T2.ShippedDate, T2.OrderDate) LIMIT 1
Database: retail_world
Question: Which company placed the order with the id 10257?
Evidence: "10257" is the OrderID; company refers to CompanyName
SQL: SELECT T1.CompanyName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10257
Database: retail_world
Question: In which year did Around the Horn place the most orders?
Evidence: Around the Horn is the CompanyName; year with the most order refers to Year (OrderDate) where Max(Count(OrderID))
SQL: SELECT STRFTIME('%Y', T2.OrderDate) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'Around the Horn' GROUP BY STRFTIME('%Y', T2.OrderDate) ORDER BY COUNT(T2.OrderID) DESC LIMIT 1
Database: retail_world
Question: How many employees report to Andrew Fuller?
Evidence: "Andrew Fuller" refers to FirstName = 'Andrew' AND LastName = 'Fuller'; report to refers to ReportsTo ! = NULL
SQL: SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' )
Database: retail_world
Question: Which country are the majority of the suppliers located?
Evidence: majority of the suppliers located refers to MAX(COUNT(SupplierID))
SQL: SELECT Country FROM Suppliers GROUP BY Country ORDER BY COUNT(SupplierID) DESC LIMIT 1
Database: retail_world
Question: What is the full name of the employees who report to the Sales Manager?
Evidence: full name refers to LastName, FirstName; the Sales Manager refers to Title = 'Sales Manager'; report to refers to ReportsTo is not NULL;
SQL: SELECT FirstName, LastName FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE Title = 'Sales Manager' )
Database: retail_world
Question: In August of 1996, how many orders were placed by the customer with the highest amount of orders?
Evidence: August of 1996 refers to OrderDate = '1996-8'; highest amount of orders refers to MAX(COUNT(OrderID))
SQL: SELECT COUNT(OrderID) FROM Orders WHERE OrderDate LIKE '1996-08%' GROUP BY CustomerID ORDER BY COUNT(OrderID) DESC LIMIT 1
Database: retail_world
Question: How much is the salary of the first employee that was hired?
Evidence: first employee that was hired refers to MIN(HireDate)
SQL: SELECT Salary FROM Employees WHERE HireDate = ( SELECT MIN(HireDate) FROM Employees )
Database: retail_world
Question: How old was the oldest employee at the time he or she was hired?
Evidence: oldest employee at the time he or she was hired refers to MAX(SUBTRACT(HireDate, Birthdate))
SQL: SELECT MAX(TIMESTAMPDIFF(YEAR, BirthDate, HireDate)) FROM Employees
Database: retail_world
Question: What is the total sales amount of all discontinued products?
Evidence: discontinued products refers to Discontinued = 1; total sales amount refers to SUM(MULTIPLY(UnitPrice, Quantity))
SQL: SELECT SUM(T2.UnitPrice * T2.Quantity) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Discontinued = 1
Database: retail_world
Question: What is the category of the product that has the highest number of discontinued products?
Evidence: discontinued products refers to Discontinued = 1; highest number of discontinued products refers to MAX(Discontinued = 1)
SQL: SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.Discontinued = 1 GROUP BY T2.CategoryName ORDER BY COUNT(T1.ProductID) DESC LIMIT 1
Database: retail_world
Question: How many condiments were sold in 1997?
Evidence: "Condiments" is the CategoryName; in 1997 refers to year(OrderDate) = 1997;
SQL: SELECT COUNT(T2.ProductID) FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID INNER JOIN Orders AS T4 ON T3.OrderID = T4.OrderID WHERE T1.CategoryName = 'Condiments' AND T1.CategoryID = 2 AND T4.OrderDate LIKE '1997%'
Database: retail_world
Question: Who is the customer who purchased the highest number of products in a single order?
Evidence: highest number of products refers to MAX(COUNT(ProductID))
SQL: SELECT T1.CompanyName 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 T1.CompanyName ORDER BY COUNT(T3.ProductID) DESC LIMIT 1
Database: retail_world
Question: What is the monthly average number of products shipped via Federal Shipping for the year 1996?
Evidence: monthly average number of products refers to DIVIDE(SUM(OrderID), 12); shipped via Federal Shipping refers to CompanyName = 'Federal Shipping'; for the year 1996 refers to year(ShippedDate) = 1996
SQL: SELECT CAST(SUM(T1.ShipVia) AS REAL) / 12 FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping' AND T1.ShippedDate LIKE '1996%'
Database: retail_world
Question: Which products are being supplied by "G'day, Mate"? List all of their names.
Evidence: supplied by "G'day, Mate" refers to CompanyName = 'G''day, Mate';
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'G%day, Mate'
Database: retail_world
Question: How many territories are there in the region with the highest number of territories?
Evidence: highest number of territories refers to max(TerritoryID)
SQL: SELECT COUNT(T2.RegionDescription), T1.TerritoryDescription, COUNT(*) AS num FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID GROUP BY T1.TerritoryDescription ORDER BY num DESC LIMIT 1
Database: retail_world
Question: What is the company name of the supplier who supplies the product with the highest unit price?
Evidence: the highest unit price refers to MAX(UnitPrice);
SQL: SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )
Database: retail_world
Question: How many female employees are in charge of 3 or more territories?
Evidence: female employees refers to TitleOfCourtesy = 'Mrs.' or TitleOfCourtesy = 'Ms.'; in charge of 3 or more territories refers to TerritoryID > = 3;
SQL: SELECT COUNT(EID) FROM ( SELECT T1.EmployeeID AS EID FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.TitleOfCourtesy IN ('Ms.' OR 'Mrs.') GROUP BY T1.EmployeeID HAVING COUNT(T2.TerritoryID) >= 3 ) T1
Database: retail_world
Question: Who are the top 8 suppliers supplying the products with the highest user satisfaction?
Evidence: highest user satisfaction refers to max(ReorderLevel);
SQL: SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID ORDER BY T1.ReorderLevel DESC LIMIT 8
Database: retail_world
Question: What is the company name of the customer who made the biggest amount of purchase in a single order before discount?
Evidence: biggest amount of purchase in a single order refers to MAX(MULTIPLY(UnitPrice, Quantity)); before discount refers to Discount = 0
SQL: SELECT T1.CompanyName 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 WHERE T3.Discount = 0 GROUP BY T1.CompanyName ORDER BY SUM(T3.UnitPrice * T3.Quantity) DESC LIMIT 1
Database: retail_world
Question: What was the total amount of sales handled by Nancy Davolio in December 1996, excluding discounts?
Evidence: in December 1996 refers to year(OrderDate) = 1996 AND month(OrderDate) = 12; excluding discounts refers to Discount = 0; total amount of sales refers to MULTIPLY((UnitPrice, Quantity))
SQL: SELECT SUM(T3.UnitPrice * T3.Quantity) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio' AND T2.OrderDate LIKE '1996-12%' AND T3.Discount = 0
Database: retail_world
Question: What is the total amount of sales made in the year 1997?
Evidence: year 1997 refers to year(OrderDate) = 1997; total amount of sales refers to (UnitPrice * Quantity)
SQL: SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.OrderDate LIKE '1997%'
Database: retail_world
Question: What is the average annual amount of shipped sales from 1997 to 1998?
Evidence: from 1997 to 1998 refers to ShippedDate > '1996-1-1' and ShippedDate < '1998-12-31'; average annual amount refers to SUM(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount)))
SQL: SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) / 3 FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.ShippedDate BETWEEN '1996-01-01 00:00:00' AND '1998-12-31 23:59:59'
Database: retail_world
Question: How many orders were shipped to Venezuela in 1996?
Evidence: shipped to Venezuela refers to ShipCountry = 'Venezuela'; in 1996 refers to year(ShippedDate) = '1996';
SQL: SELECT COUNT(OrderID) FROM Orders WHERE ShipCountry = 'Venezuela' AND STRFTIME('%Y', ShippedDate) = '1996'
Database: retail_world
Question: What are the ID and description of the condiments category?
Evidence: condiments category refers to CategoryName = 'Condiments'; the ID refers to CategoryID
SQL: SELECT CategoryID, Description FROM Categories WHERE CategoryName = 'Condiments'
Database: retail_world
Question: List the order IDs, product IDs and unit price of orders which total payment is greater than 15000.
Evidence: total payment is greater than 15000 refers to MULTIPLY((Quantity * UnitPrice * (1 - Discount))) > 15000

SQL: SELECT ProductID, OrderID, UnitPrice FROM `Order Details` WHERE UnitPrice * Quantity * (1 - Discount) > 15000
Database: retail_world
Question: Provide the territory IDs under employee ID of 7.
SQL: SELECT TerritoryID FROM EmployeeTerritories WHERE EmployeeID = 7
Database: retail_world
Question: Provide the supplier company name in Sydney and its homepage address if available.
Evidence: in Sydney refers to City = 'Sydney';
SQL: SELECT CompanyName, HomePage FROM Suppliers WHERE City = 'Sydney'
Database: retail_world
Question: Write down the full name of Vie President of Sales and his age when he was hired.
Evidence: Vice President of Sales refers to Title = 'Vice President, Sales';
SQL: SELECT FirstName, LastName , TIMESTAMPDIFF(YEAR, BirthDate, HireDate) AS AGE FROM Employees WHERE Title = 'Vice President, Sales'
Database: retail_world
Question: List the supplier company names located in Germany.
Evidence: located in Germany refers to Country = 'Germany';
SQL: SELECT CompanyName FROM Suppliers WHERE Country = 'Germany'
Database: retail_world
Question: List the employees' full names and ages in 2022 who lived in London.
Evidence: in London refers to City = 'London'; ages in 2022 refers to SUBTRACT(2022, year(BirthDate)); full names refers to FirstName, LastName
SQL: SELECT TitleOfCourtesy, FirstName, LastName , TIMESTAMPDIFF(YEAR, BirthDate, NOW()) AS ages FROM Employees WHERE City = 'London'
Database: retail_world
Question: List down the customer company names, addresses, phones and faxes which are located in London.
Evidence: in London refers to City = 'London'
SQL: SELECT CompanyName, Address, Phone, Fax FROM Customers WHERE City = 'London'
Database: retail_world
Question: List the full name of employees and titles who have to report to Sales Manager.
Evidence: Sales Manager refers to Title = 'Sales Manager'; full name refers to FirstName, LastName
SQL: SELECT FirstName, LastName, Title FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE Title = 'Sales Manager' )
Database: retail_world
Question: List all the customer company names and cities located in Canada.
Evidence: located in Canada refers to Country = 'Canada'
SQL: SELECT CompanyName, City FROM Customers WHERE Country = 'Canada'
Database: retail_world
Question: Find the total production amount and product names which had "10 - 500 g pkgs." as quantity per unit.
Evidence: total production amount refers to ADD(UnitsInstock, UnitsOnOrder)
SQL: SELECT UnitsInStock + UnitsOnOrder, ProductName FROM Products WHERE QuantityPerUnit = '10 - 500 g pkgs.'
Database: retail_world
Question: List all the product names and categories of the highest reorder level.
Evidence: Highest reorder level refers to Max(ReorderLevel)
SQL: SELECT T2.ProductName, T1.CategoryName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID ORDER BY T2.ReorderLevel DESC LIMIT 1
Database: retail_world
Question: Describe the supplier companies, cities and products which total production amount is more than 120.
Evidence: total production amount is more than 120 refers to ADD(UnitsInstock, UnitsOnOrder) > 120
SQL: SELECT T2.CompanyName, T2.City, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock + UnitsOnOrder > 120
Database: retail_world
Question: Provide the contact person name, title and supplied products by "Escargots Nouveaux" company.
Evidence: "Escargots Nouveaux" company refers to CompanyName = 'Escargots Nouveaux';
SQL: SELECT T2.ContactName, T2.ContactTitle, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Escargots Nouveaux'
Database: retail_world
Question: List the territory IDs, description and region description under the in-charge of Mrs. Margaret Peacock.
SQL: SELECT T3.TerritoryID, T3.TerritoryDescription, T4.RegionDescription 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 T1.TitleOfCourtesy = 'Mrs.' AND T1.LastName = 'Peacock' AND T1.FirstName = 'Margaret'
Database: retail_world
Question: What were the products supplied by the company in Spain?
Evidence: company in Spain refers to Country = 'Spain'; product supplied refers to ProductName
SQL: SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Spain'
Database: retail_world
Question: What products were ordered by the customer ID "WILMK" which were required on 3/26/1998?
Evidence: required on 3/26/1998 refers to RequiredDate = '1998-03-26 00:00:00'; products ordered refers to ProductName
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.RequiredDate LIKE '1998-03-26%' AND T1.CustomerID = 'WILMK'
Database: retail_world
Question: Provide the list of product IDs and names under the meat/poultry category.
Evidence: meat/poultry category refers to CategoryName = 'Meat/Poultry';
SQL: SELECT T2.ProductName, T1.CategoryName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )
Database: retail_world
Question: How many orders were made by the customers in Ireland.
Evidence: in Ireland refers to Country = 'Ireland';
SQL: SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Country = 'Ireland'
Database: retail_world
Question: Provide the products list which were ordered in 1996 by the company in Norway.
Evidence: ordered in 1996 refers to year(OrderDate) = 1996; in Norway refers to Country = 'Norway'
SQL: SELECT T4.ProductName 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 INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID WHERE T1.Country = 'Norway' AND STRFTIME('%Y', T2.OrderDate) = '1996'
Database: retail_world
Question: Among orders shipping to Brazil, mention the supplier company of the order which was done by employee Anne Dodsworth in December, 1996 .
Evidence: shipping to Brazil refers to ShipCountry = 'Brazil'; in December, 1996  refers to year(OrderDate) = 1996 and month(OrderDate) = 12;
SQL: SELECT T5.CompanyName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID INNER JOIN Suppliers AS T5 ON T4.SupplierID = T5.SupplierID WHERE T1.FirstName = 'Anne' AND T1.LastName = 'Dodsworth' AND T2.ShipCountry = 'Brazil' AND T2.OrderDate LIKE '1996-12%'
Database: retail_world
Question: Mention the oldest empoyee's full name, title, salary and number of orders which were shipped to USA by him.
Evidence: full name refers to FirstName, LastName; shipped to USA refers to ShipCountry = 'USA'
SQL: SELECT T1.FirstName, T1.LastName, T1.Title, T1.Salary , COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE ShipCountry = 'USA' GROUP BY T1.FirstName, T1.LastName, T1.Title, T1.Salary, T1.BirthDate ORDER BY T1.BirthDate LIMIT 1
Database: retail_world
Question: List down the territory IDs and descriptions existed in Southern region.
Evidence: in Southern region refers to RegionDescription = 'Southern';
SQL: SELECT T1.TerritoryID, T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern'
Database: retail_world
Question: Calculate the average payment per product under confections category.
Evidence: under confections category refers to CategoryName = 'Confections';
SQL: SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) / 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 = 'Confections'
Database: retail_world
Question: Find the total payment of the orders by customers from San Francisco.
Evidence: from San Francisco refers to City = 'San Francisco'; total payment refers to sum(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount)))
SQL: SELECT SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) AS TOTALPAYMENT 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 WHERE T1.City = 'San Francisco'
Database: retail_world
Question: Calculate the total production for each product which were supplied from Japan
Evidence: from Japan refers to Country = 'Japan'; total production refers to ADD(UnitsInstock, UnitsOnOrder)
SQL: SELECT SUM(T1.UnitsInStock + T1.UnitsOnOrder) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'
Database: retail_world
Question: Among the supplied products from Australia, describe the discontinued products and the category.
Evidence: from Australia refers to Country = 'Australia'; discontinued products refers to Discontinued = 1;
SQL: SELECT T2.ProductName, T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T1.Country = 'Australia' AND T2.Discontinued = 1
Database: retail_world
Question: Mention the supplier country of Ipoh Coffee and the order ID which had maximum in total payment.
Evidence: Ipoh Coffee refers to ProductName = 'Ipoh Coffee'; maximum in total payment refers to MAX(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount)))
SQL: SELECT T3.Country, T1.OrderID FROM `Order Details` AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Suppliers AS T3 ON T2.SupplierID = T3.SupplierID WHERE T2.ProductName = 'Ipoh Coffee' ORDER BY T1.UnitPrice * T1.Quantity * (1 - T1.Discount) DESC LIMIT 1
Database: retail_world
Question: Provide the list of products ordered by ID 10979 and calculate its total payment.
Evidence: ordered by ID 10979 refers to OrderID = '10979'; total payment refers to SUM(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount)))
SQL: SELECT T1.ProductName , SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10979 GROUP BY T1.ProductName
Database: retail_world
Question: Among the products under grains/cereals category, provide the contact person and title of the supplier with one digit ID.
Evidence: grains/cereals category refers to CategoryName = 'Grains/Cereals'; supplier with one digit ID refers to SupplierID between 1 and 10;
SQL: SELECT DISTINCT T1.ContactName, T1.ContactTitle FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Grains/Cereals' AND T1.SupplierID BETWEEN 1 AND 10 LIMIT 1
Database: retail_world
Question: Provide Speedy Express's phone number and number of shipped orders on 30th January, 1998.
Evidence: Speedy Express's refers to CompanyName = 'Speedy Express'; orders on 30th January, 1998 refers to ShippedDate = '1998-01-30 00:00:00'
SQL: SELECT T2.Phone, COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express' AND T1.ShippedDate LIKE '1998-01-30%' GROUP BY T2.Phone