Chinastark/bird_dataset huggingface dataset:
Database: retail_world
Question: What are the total products value shipped to Brazil by Speedy Express Company?
Evidence: shipped to Brazil refers to ShipCountry = 'Brazil'; by Speedy Express Company refers to CompanyName = 'Speedy Express'; total products value refers to sum(MULTIPLY(UnitPrice, Quantity))
SQL: SELECT SUM(T2.Quantity * T2.UnitPrice) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Shippers AS T3 ON T1.ShipVia = T3.ShipperID WHERE T3.CompanyName = 'Speedy Express' AND T1.ShipCountry = 'Brazil'
Database: retail_world
Question: How many subordinates does employee ID 2 have and what is the biggest order in terms of value that his/her subordinates have created?
Evidence: subordinates of employee ID 2 refers to EmployeeID where ReportsTo = 2;  biggest order in terms of value refers to max(MULTIPLY(Quantity, UnitPrice))
SQL: SELECT COUNT(T1.EmployeeID), SUM(T3.Quantity * T3.UnitPrice) 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.ReportsTo = 2 ORDER BY SUM(T3.UnitPrice * T3.Quantity) DESC LIMIT 1
Database: retail_world
Question: How many sales values have been created by sales representative and which sales representative have the highest sales?
Evidence: sales representative refers to Title = 'Sales Representative'; sales values refers to MULTIPLY(Quantity, UnitPrice); the highest sales refers to max(MULTIPLY(Quantity, UnitPrice))
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.Title = 'Sales Representative' ORDER BY SUM(T3.UnitPrice * T3.Quantity)
Database: retail_world
Question: How many employees is a UK citizen and are they all covering the same region?
Evidence: is a UK citizen refers to Country = 'UK'
SQL: SELECT COUNT(T1.EmployeeID), T3.RegionID 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.Country = 'UK' GROUP BY T3.RegionID
Database: retail_world
Question: Which customer have the biggest purchase in one order and where does this order being ship to?
Evidence: biggest purchase refers to max(ProductID.Order_Details); ship to refers to ShipCountry
SQL: SELECT T1.CompanyName, T2.ShipCountry 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, T2.ShipCountry ORDER BY COUNT(T3.ProductID) DESC LIMIT 1
Database: retail_world
Question: Which customer is a regular customer in this shop and what are the products category that he mostly buy?
Evidence: regular customer refers to max(count(CustomerID)); products category refers to CategoryName; mostly buy refers to max(count(CategoryID))
SQL: SELECT T1.CustomerID, T4.CategoryName 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 INNER JOIN Categories AS T4 ON T3.CategoryID = T4.CategoryID ORDER BY T1.CustomerID DESC, T4.CategoryName DESC
Database: retail_world
Question: What are the most popular confections product and calculate the total sales generated by this product?
Evidence: most popular confections product refers to ProductID = max(count(MULTIPLY(Quantity, UnitPrice))) from CategoryName = 'Confections' ;  total sales refers to sum(MULTIPLY(Quantity, UnitPrice))
SQL: SELECT COUNT(T1.UnitPrice * T3.Quantity) FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID INNER JOIN `Order Details` AS T3 ON T1.ProductID = T3.ProductID WHERE T2.CategoryName = 'Confections' GROUP BY T3.Quantity ORDER BY T3.Quantity DESC LIMIT 1
Database: retail_world
Question: What is the name of product with the ID of 77?
Evidence: name of product refers to ProductName; ID refers to ProductID
SQL: SELECT ProductName FROM Products WHERE ProductID = 77
Database: retail_world
Question: State the company name of all suppliers in USA.
Evidence: in USA refers to Country = 'USA'
SQL: SELECT CompanyName FROM Suppliers WHERE Country = 'USA'
Database: retail_world
Question: What is the position title for Laura Callahan?
SQL: SELECT Title FROM Employees WHERE FirstName = 'Laura' AND LastName = 'Callahan'
Database: retail_world
Question: State the name of employee that manages the order from Victuailles en stock?
Evidence: name of employee refers to FirstName; from Victuailles en stock refers to CompanyName = 'Victuailles en stock'
SQL: SELECT DISTINCT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.CompanyName = 'Victuailles en stock'
Database: retail_world
Question: How many orders were shipped by Federal Shipping?
Evidence: Federal Shipping refers to CompanyName = 'Federal Shipping'
SQL: SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping'
Database: retail_world
Question: Who was taking charge of orders from Morristown?
Evidence: Morristown refers to TerritoryDescription = 'Morristown'
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 = 'Morristown'
Database: retail_world
Question: State the name of all territories in Northern region.
Evidence: name of all territories refers to TerritoryDescription; Northern region refers to RegionDescription = 'Northern'
SQL: SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Northern'
Database: retail_world
Question: How many orders were handled by Michael Suyama. State the order ID.
SQL: SELECT COUNT(T2.OrderID) 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: What is the ratio number of territories in Northern region and number territories in Western region?
Evidence: Northern region refers to RegionID = 3; Western region refers to RegionID = 2 ; ratio = divide((TerritoryDescription where RegionID = 3), (TerritoryDescription where RegionID = 2))
SQL: SELECT CAST(( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Northern' ) AS REAL) * 100 / ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Westerns' ) AS Calu
Database: retail_world
Question: Provide employees' ID who are in-charge of territory ID from 1000 to 2000.
Evidence: territory ID from 1000 to 2000 refers to TerritoryID BETWEEN 1000 and 2000
SQL: SELECT EmployeeID FROM EmployeeTerritories WHERE TerritoryID BETWEEN 1000 AND 2000
Database: retail_world
Question: List down the territory IDs, descriptions and region description which are under the in-charge of Nancy Davolio,
Evidence: descriptions refers to TerritoryDescription; region refers to RegionDescription
SQL: SELECT T3.RegionID, 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.LastName = 'Davolio' AND T1.FirstName = 'Nancy'
Database: retail_world
Question: Describe Sales Representative names who were hired in 1992 and compare the number of orders among them.
Evidence: Sales Representative refers to Title = 'Sales Representative'；were hired in 1992 refers to HireDate = '1992'
SQL: SELECT T1.FirstName, T1.LastName, COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.Title = 'Sales Representative' AND STRFTIME('%Y', T1.HireDate) = '1992' GROUP BY T1.EmployeeID, T1.FirstName, T1.LastName
Database: retail_world
Question: Calculate the total payment of orders for Vegie-spread product.
Evidence: Vegie-spread product refers to ProductName = 'Vegie-spread'；total payment = MULTIPLY(UnitPrice, Quantity, (1-Discount))
SQL: SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) AS sum FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Vegie-spread'
Database: retail_world
Question: List down the company names which supplied products for the order on 14th August, 1996.
Evidence: products refers to Order_Details.ProductID; on 14th August, 1996 refers to OrderDate = '8/14/1996'
SQL: SELECT T1.CompanyName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID INNER JOIN Orders AS T4 ON T3.OrderID = T4.OrderID WHERE date(T4.OrderDate) = '1996-08-14'
Database: retail_world
Question: Among the product lists in order ID 10337, write down the product names and suppliers which had the highest in reorder level.
Evidence: suppliers refers to CompanyName; highest in reorder level refers to Max(ReorderLevel)
SQL: SELECT T2.ProductName, T1.CompanyName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID WHERE T3.OrderID = 10337 ORDER BY T2.ReorderLevel DESC LIMIT 1
Database: retail_world
Question: Name the shipper which had the most shipments in first quarter of 1998.
Evidence: Name the shipper refers to CompanyName; most shipments refers to max(count(OrderID)); first quarter of 1998 refers to ShippedDate = 1998/1 and ShippedDate = 1998/2 and ShippedDate = 1998/3 and ShippedDate = 1998/4
SQL: SELECT T1.CompanyName FROM Shippers AS T1 INNER JOIN Orders AS T2 ON T1.ShipperID = T2.ShipVia WHERE STRFTIME('%Y', T2.ShippedDate) = '1998' GROUP BY T1.CompanyName ORDER BY COUNT(T2.OrderID) DESC LIMIT 1
Database: retail_world
Question: How many customers are located in London?
Evidence: London refers to City = 'London'
SQL: SELECT COUNT(CustomerID) FROM Customers WHERE City = 'London'
Database: retail_world
Question: What is the title of Michael Suyama?
SQL: SELECT Title FROM Employees WHERE FirstName = 'Michael' AND LastName = 'Suyama'
Database: retail_world
Question: List out the full name of employee who has birth day on "3/4/1955 12:00:00 AM".
Evidence: full name refers to FirstName, LastName; brith day refers to BirthDate
SQL: SELECT FirstName, LastName FROM Employees WHERE BirthDate = '1955-03-04 00:00:00'
Database: retail_world
Question: Mention the first name of employee who took care the order id 10250.
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10250
Database: retail_world
Question: How many orders that the employees who are located in Tacoma handled?
Evidence: located in Tacoma refers to City = 'Tacoma'
SQL: SELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.City = 'Tacoma'
Database: retail_world
Question: What is the country location of the employee who handled order id 10257?
SQL: SELECT T1.Country FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10257
Database: retail_world
Question: What is the title of the employee who handled order id 10270?
SQL: SELECT T1.Title FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10257
Database: retail_world
Question: Give the phone number of the customer who placed the order id 10264.
SQL: SELECT T1.Phone FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10264
Database: retail_world
Question: What is the region where the customer who placed the order id 10276 located?
SQL: SELECT T1.Region FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10276
Database: retail_world
Question: Among the employees who handled orders to Brazil, who has the highest salary and calculate the average salary of them.
Evidence: orders to Brazil refers to ShipCountry = 'Brazil'; highest salary refers to max(salary); average salary = AVG(Salary)
SQL: SELECT T1.FirstName, T1.LastName, AVG(T1.Salary) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.ShipCountry = 'Brazil' GROUP BY T1.FirstName, T1.LastName ORDER BY SUM(T1.Salary) DESC LIMIT 1
Database: retail_world
Question: Calculate the percentage salary of employees who handled orders shipped in 1996.
Evidence: shipped in 1996 refers to ShippedDate = 1996; percentage salary = divide(sum(Salary when ShippedDate = 1996), sum(Salary)) as percentage
SQL: SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T2.ShippedDate) = '1996' THEN T1.Salary ELSE 0 END) AS REAL) * 100 / SUM(T1.Salary) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID
Database: retail_world
Question: When was the employee who handled order id 10281 hired?
Evidence: When was hired refers to HireDate
SQL: SELECT T1.HireDate FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10281
Database: retail_world
Question: How many orders was handled by employees who reported to employee id 5?
Evidence: reported to employee id 5 refers to ReportsTo = 5
SQL: SELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.ReportsTo = 5
Database: retail_world
Question: Give the full name of employee who handled the order id 10280.
Evidence: full name refers to FirstName, LastName
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10280
Database: retail_world
Question: State the shipping company of order id 10260.
Evidence: shipping company refers to CompanyName
SQL: SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10260
Database: retail_world
Question: How many orders have been shipped through United Package?
Evidence: shipped through refers to ShipVia; United Package refers to CompanyName = 'United Package'
SQL: SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'United Package'
Database: retail_world
Question: List out the phone number of the shipping company of order id 10296.
Evidence: shipping company refers to Shippers; phone number refers to Phone
SQL: SELECT T2.Phone FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10260
Database: retails
Question: How many kinds of items are returned in order no.5?
Evidence: returned refer to l_returnflag = 'R'; order no.5 refers to l_orderkey = 5; kinds of items refer to l_linenumber;
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_orderkey = 5 AND l_returnflag = 'R'
Database: retails
Question: When was the latest date the items of order no.1 were shipped?
Evidence: order no.1 refers to l_orderkey = 1; the latest date shipped refers to MAX(l_shipdate);
SQL: SELECT MAX(l_shipdate) FROM lineitem WHERE l_orderkey = 1
Database: retails
Question: Which order has a higher priority, order no. 4 or order no. 36?
Evidence: earlier orderdate have higher priority in delivery; which order no. 4 or order no. 36 refers to o_orderkey in (4, 36) where MIN(o_orderdate);
SQL: SELECT l_orderkey FROM lineitem WHERE l_orderkey IN (4, 36) ORDER BY l_shipdate DESC LIMIT 1
Database: retails
Question: What is the comment of the order with the highest total price?
Evidence: the highest total price refers to MAX(o_totalprice); comment of the order refers to o_comment;
SQL: SELECT o_comment FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )
Database: retails
Question: What is the phone number of Customer#000000001?
Evidence: customer phone refers to c_phone; Customer#000000001 refers to c_name;
SQL: SELECT c_phone FROM customer WHERE c_name = 'Customer#000000001'
Database: retails
Question: How many orders in total have the customers in the household segment made?
Evidence: orders in household segment refer to o_orderkey where c_mktsegment = 'HOUSEHOLD';
SQL: SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'
Database: retails
Question: Among all the orders made by a customer in the household segment, what is the highest total price?
Evidence: orders in household segment refer to o_orderkey where c_mktsegment = 'HOUSEHOLD'; the highest total price refers to MAX(o_totalprice);
SQL: SELECT MAX(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'
Database: retails
Question: Please list the order comments of all the orders made by customers in the household segment.
Evidence: orders in household segment refer to o_orderkey where c_mktsegment = 'HOUSEHOLD'; order comments refer to o_comment;
SQL: SELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'
Database: retails
Question: Please give the name of the customer who has made the single order with the highest total price.
Evidence: name of the customer refers to c_name; single order with the highest total price refers to MAX(o_totalprice) LIMIT 1;
SQL: SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1
Database: retails
Question: Please list the order keys of all the orders made by a customer whose account is in debt.
Evidence: account is in debt if c_acctbal < 0;
SQL: SELECT T1.o_orderkey FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_acctbal < 0
Database: retails
Question: Among the orders made by customers in the household segment, how many of them are urgent?
Evidence: orders in household segment refer to o_orderkey where c_mktsegment = 'HOUSEHOLD'; the order is urgent if o_orderpriority = '1-URGENT' ;
SQL: SELECT COUNT(T1.o_orderpriority) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD' AND T1.o_orderpriority = '1-URGENT'
Database: retails
Question: How many customers are in Brazil?
Evidence: Brazil is the name of the nation which refers to n_name = 'BRAZIL'
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'BRAZIL'
Database: retails
Question: Please list the phone numbers of all the customers in the household segment and are in Brazil.
Evidence: phone numbers refer to c_phone; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; household segment refers to c_mktsegment = 'HOUSEHOLD';
SQL: SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'BRAZIL'
Database: retails
Question: Among all the customers in Germany, how many of them have an account balance of over 1000?
Evidence: Germany is the name of the nation which refers to n_name = 'GERMANY'; account balance of over 1000 refers to c_acctbal > 1000;
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY' AND T1.c_acctbal > 1000
Database: retails
Question: How many orders in total are made by customers in Germany?
Evidence: orders refer to o_orderkey; Germany is the name of the nation which refers to n_name = 'GERMANY';
SQL: SELECT COUNT(T2.c_custkey) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'
Database: retails
Question: What is the total price of all the orders made by customers in Germany?
Evidence: orders refer to o_orderkey; total price refers to o_totalprice; Germany is the name of the nation which refers to n_name = 'GERMANY';
SQL: SELECT SUM(T3.o_totalprice) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'
Database: retails
Question: Among the orders made by customers in Germany, which one of them has the highest priority in delivery? Please give its order key.
Evidence: orders refer to o_orderkey; Germany is the name of the nation which refers to n_name = 'GERMANY'; earlier orderdate have higher priority in delivery therefore MIN(o_orderdate);
SQL: SELECT T3.o_orderkey FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY' ORDER BY T3.o_orderdate LIMIT 1
Database: retails
Question: What is the average price of the orders made by a customer in Germany?
Evidence: DIVIDE(SUM(o_totalprice), COUNT(o_orderkey)) where n_name = 'GERMANY';
SQL: SELECT AVG(T3.o_totalprice) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'
Database: retails
Question: Among all the customers, what is the percentage of the customer's nation being Germany?
Evidence: DIVIDE(COUNT(c_custkey when n_name = 'GERMANY'), COUNT(c_custkey)) as percentage;
SQL: SELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey
Database: retails
Question: How many countries are there in the No.2 region?
Evidence: No.2 region refers to n_regionkey = 2;
SQL: SELECT COUNT(n_nationkey) FROM nation WHERE n_regionkey = 2
Database: retails
Question: Which country does supplier No.34 come from?
Evidence: supplier No.34 refers to s_suppkey = 34; country refers to n_name;
SQL: SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 34
Database: retails
Question: Which region does "Supplier#000000129" belong to?
Evidence: "Supplier#000000129" is the name of the supplier which refers to s_name; Which region refers to r_name;
SQL: SELECT T3.r_name FROM nation AS T1 INNER JOIN supplier AS T2 ON T1.n_nationkey = T2.s_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.s_name = 'Supplier#000000129'
Database: retails
Question: What is the nationality of "Customer#000000055"?
Evidence: "Customer#000000055" is the name of the customer which refers to c_name; nationality is the state of belonging to a particular country, therefore nationality refers to n_name;
SQL: SELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_name = 'Customer#000000055'
Database: retails
Question: Give customer No.106936's region name.
Evidence: "Customer#000000055" is the name of the customer which refers to c_name; region name refers to r_name;
SQL: SELECT T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_custkey = 106936
Database: retails
Question: Give the number of Moroccan customers whose account is in debt.
Evidence: account is in debt if c_acctbal < 0; Moroccan customers refer to c_name WHERE n_name = 'MOROCCO';
SQL: SELECT COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'MOROCCO' AND T1.c_acctbal < 0
Database: retails
Question: For the order with the total price of 231499.38, what was the discounted price for supplier No. 9397?
Evidence: MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)) where o_totalprice = 231499.38 AND l_suppkey = 9397;
SQL: SELECT T1.l_extendedprice * (1 - T1.l_discount) AS DISCOUNTERPRICE FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE T1.l_suppkey = 9397 AND T2.o_totalprice = 231499.38