db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 1
673
⌀ | SQL
stringlengths 23
804
| schema
stringclasses 69
values |
|---|---|---|---|---|
retail_world
|
Calculate the percentage of shipping done through Speedy Express.
|
through Speedy Express refers to CompanyName = 'Speedy Express'; percentage = divide(count(ShipperID where CompanyName = 'Speedy Express') , count(ShipperID)) * 100%
|
SELECT CAST(COUNT(CASE WHEN T2.CompanyName = 'Speedy Express' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.ShipVia) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Indicate the courtesy title of the 3 employees who have the lowest salary.
|
courtesy title refers to TitleOfCourtesy; the lowest salary refers to MIN(Salary);
|
SELECT TitleOfCourtesy FROM Employees ORDER BY Salary LIMIT 3
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the last name of the employees who must report to the Vice President of Sales?
|
report to represents a hierarchical relationship where the person being reported to is usually the direct supervisor of the reporter; Vice President of Sales refers to Title = 'Vice President, Sales';
|
SELECT LastName FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE Title = 'Vice President, Sales' )
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the highest total price paid for an order?
|
the highest total price paid for an order can be calculated as MAX(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1-Discount)));
|
SELECT UnitPrice * Quantity * (1 - Discount) AS THETOP FROM `Order Details` ORDER BY UnitPrice * Quantity * (1 - Discount) DESC LIMIT 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which 3 products are produced in greater quantity?
|
3 products produced in greater quantity refer to MAX(SUM(UnitsInStock, UnitsOnOrder)) Limit 3;
|
SELECT ProductName FROM Products ORDER BY UnitsInStock + UnitsOnOrder DESC LIMIT 3
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Of the 10 products with the highest unit price, identify by their ID the ones that have generated the least satisfaction.
|
High reorder level generally means high user satisfaction of the product and vice versa; the least satisfaction refers to MIN(ReorderLevel); the highest unit price refers to MAX(UnitPrice);
|
SELECT ProductID FROM Products ORDER BY ReorderLevel ASC, UnitPrice DESC LIMIT 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many non-discontinued products are there in the dairy category?
|
non-discontinued products in the dairy category refer to ProductID where Discontinued = 0 and CategoryName = 'Dairy Products';
|
SELECT COUNT(T1.CategoryID) FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.Discontinued = 0
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What territories is the Inside Sales Coordinator in charge of?
|
territories refer to TerritoryDescription; Title = 'Inside Sales Coordinator';
|
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.Title = 'Inside Sales Coordinator'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Indicate the name of the companies that have freighted products for a value greater than 2,000,000.
|
freighted products for a value greater than 2,000,000 refer to Freight > 2000000; name of companies refers to CompanyName;
|
SELECT T1.CompanyName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Freight > 2000000
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Through which companies have products been shipped the most times to the city of Aachen?
|
shipped the most times refer to MAX(COUNT(ShipVia)); city of Aachen refers to ShipCity = 'Aache'; companies refers to CompanyName;
|
SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.ShipCity = 'Aachen' GROUP BY T2.CompanyName ORDER BY COUNT(T1.ShipVia) DESC LIMIT 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List the full name of all employees who work in the Northern region.
|
full names = FirstName, LastName; Northern region refers to RegionDescription = 'Northern';
|
SELECT DISTINCT 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 INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Northern'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the name of the contact person of the Pavlova supplier company?
|
contact person refers to ContactName; Pavlova is the name of the product;
|
SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Pavlova'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Indicate the name of the products that have been shipped to the city of Paris.
|
shipped to the city of Paris refers to ShipCity = 'Paris';
|
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.ShipCity = 'Paris'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What product is the least shipped to the postal code 28023?
|
the least shipped product refers ProductName where MIN(Quantity);
|
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.PostalCode = 28023 ORDER BY T3.Quantity LIMIT 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the full name of the employee in charge of the Southern region who is to report to Andrew Fuller?
|
full names = FirstName, LastName; report to represents a hierarchical relationship where the person being reported to is usually the direct supervisor of the reporter; Andrew Fuller refers to Employees WHERE FirstName = 'Andrew' AND LastName = 'Fuller'; Southern region refers to RegionDescription = 'Southern';
|
SELECT DISTINCT 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 INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Southern' AND T1.ReportsTo = ( SELECT EmployeeID FROM Employees WHERE FirstName = 'Andrew' AND LastName = 'Fuller' )
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
On what date did the Du monde entier company request that 9 units of Filo Mix be sent to it?
|
9 units of Filo Mix refer to ProductName where Quantity = 9; Du monde entier is the name of the customer; date refers to OrderDate;
|
SELECT T2.OrderDate 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 T4.ProductName = 'Filo Mix' AND T3.Quantity = 9 AND T1.CompanyName = 'Du monde entier'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Indicate the name of the categories to which the products of order number 10933 belong.
|
order number 10933 refers to OrderID = 10933;
|
SELECT T3.CategoryName 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 T2.OrderID = 10933
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the phone number for the employee in charge of the Portsmouth territory?
|
phone refers to HomePhone; Portsmouth territory refers to TerritoryDescription = 'Portsmouth';
|
SELECT T1.HomePhone 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 = 'Portsmouth'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the average quantity of product that have been shipped by Federal Shipping in November 1996?
|
Federal Shipping refers to CompanyName = 'Federal Shipping'; DIVIDE(SUM(Quantity), COUNT(ProductID)) where CompanyName = 'Federal Shipping' and ShippedDate > = '1996-11-01 00:00:00' AND ShippedDate < '1996-12-01 00:00:00';
|
SELECT CAST(SUM(T2.Quantity) AS REAL) / COUNT(T2.OrderID) 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 T1.ShippedDate LIKE '1996-11%' AND T3.CompanyName = 'Federal Shipping'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Of all the shipments made by United Package throughout the year 1996, what percentage correspond to the month of September?
|
DIVIDE(COUNT(OrderID where CompanyName = 'United Package' and ShippedDate > = '1996-09-01 00:00:00' AND ShippedDate < '1996-09-30 00:00:00')), (COUNT(OrderID where CompanyName = 'United Package' and ShippedDate > = '1996-01-01 00:00:00' AND ShippedDate < '1997-01-01 00:00:00')) as percentage;
|
SELECT CAST(COUNT(CASE WHEN T1.ShippedDate LIKE '1996-09%' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.ShipVia) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'United Package' AND T1.ShippedDate LIKE '1996%'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many owners are located in Mexico?
|
owners in Mexico refer to ContactTitle where Country = 'Mexico';
|
SELECT COUNT(ContactTitle) FROM Customers WHERE Country = 'Mexico' AND ContactTitle = 'Owner'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the full address of Andr Fonseca?
|
full address includes Address, City, Region, PostalCode and Country; ContactName = 'Andr Fonseca';
|
SELECT Address, City, Region, PostalCode, Country FROM Customers WHERE ContactName = 'Andr Fonseca'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the companies that have the same phone area code as 171?
|
phone area code as 171 refers to Phone LIKE '(171)%'; companies refer to CompanyName;
|
SELECT CompanyName FROM Customers WHERE Phone LIKE '(171)%'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the difference in the number of employees from the UK and the USA who work as sales representatives?
|
SUBTRACT(COUNT(EmployeeID where Country = 'UK' and Title = 'sales representative'), COUNT(EmployeeID where Country = 'USA' and Title = 'sales representative'));
|
SELECT ( SELECT COUNT(Title) FROM Employees WHERE Country = 'UK' AND Title = 'Sales Representative' ) - ( SELECT COUNT(Title) FROM Employees WHERE Country = 'USA' AND Title = 'Sales Representative' ) AS DIFFERENCE
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many sales associates are located in Sao Paulo, Brazil?
|
sales associates refer to ContactTitle; Sao Paulo is the name of the city in the country Brazil;
|
SELECT COUNT(CustomerID) FROM Customers WHERE City = 'Sao Paulo' AND Country = 'Brazil' AND ContactTitle = 'Sales Associate'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the family name of the employee who shipped the order 10521 to CACTU?
|
order 10521 refers to OrderID = 10521; CustomerID = 'CACTU'; family name refers to LastName;
|
SELECT T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10521 AND T2.CustomerID = 'CACTU'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the shipping cost for order number 10692 from the company Alfreds Futterkiste?
|
Alfreds Futterkiste is the name of the company; order number 10692 refers to OrderID = 10692;
|
SELECT T2.Freight FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10692 AND T1.CompanyName = 'Alfreds Futterkiste'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the shipping company for order number 10558?
|
order number 10558 refers to OrderID = 10558;
|
SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10558
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Please list any three order numbers that have been shipped using Speedy Express.
|
Speedy Express is the name of the shipping company; three order numbers refer to OrderID LIMIT 3;
|
SELECT T1.OrderID FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express' LIMIT 3
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the products that belong to the beverage category?
|
products belong to beverage category refer to ProductName where CategoryName = 'beverage';
|
SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Beverages'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the description of the category that tofu belongs to?
|
tofu is the name of the product;
|
SELECT T1.Description FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.ProductName = 'tofu'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which company supplies Gula Malacca?
|
Gula Malacca is the name of the product; company refers to CompanyName;
|
SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Gula Malacca'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the products that are supplied by Aux joyeux ecclsiastiques?
|
Aux joyeux ecclsiastiques is the name of supply company; products refer to ProductName;
|
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Aux joyeux ecclsiastiques'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How much per unit of Konbu does Mayumi's charge?
|
Mayumi's is the name of the company; how much per unit of Konbu refers to UnitPrice where ProductName = 'Konbu';
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Who is the person to contact to get Camembert Pierrot?
|
Camembert Pierrot is the name of the product; person to contact refers to ContactName;
|
SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Camembert Pierrot'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Please name any three products that have been discontinued in the meat or poultry category.
|
three products that have been discontinued refer to ProductName LIMIT 3 where Discontinued = 1; CategoryName = 'Meat/Poultry';
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Please name any two products that have the highest satisfaction levels among users of Heli Swaren GmbH & Co. KG.
|
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';
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Who is the one representing the company "Heli Swaren GmbH & Co. KG"?
|
Heli Swaren GmbH & Co. KG is the name of the company; who is representing refers to ContactName;
|
SELECT ContactName FROM Suppliers WHERE CompanyName = 'Heli Swaren GmbH & Co. KG'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
From which country is the company "Drachenblut Delikatessen" from?
|
Drachenblut Delikatessen is the company name;
|
SELECT Country FROM Customers WHERE CompanyName = 'Drachenblut Delikatessen'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many territories are there?
| null |
SELECT COUNT(TerritoryID) FROM Territories
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the largest total price for an order?
|
the largest total price for an order can be calculated as MAX(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1-Discount)));
|
SELECT SUM(UnitPrice) FROM `Order Details` GROUP BY OrderID ORDER BY SUM(UnitPrice) DESC LIMIT 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which product is the most expensive?
|
most expensive product refers to ProductName where MAX(UnitPrice);
|
SELECT ProductName FROM Products WHERE UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many of the orders are shipped to France?
|
shipped to France refers to ShipCountry = 'France';
|
SELECT COUNT(ShipCountry) FROM Orders WHERE ShipCountry = 'France'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which region does Hoffman Estates belong to?
|
Hoffman Estates refer to TerritoryDescription;
|
SELECT T2.RegionDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T1.TerritoryDescription = 'Hoffman Estates'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the homepage link for the company that supplies the product "Thringer Rostbratwurst"?
|
ProductName = 'Thringer Rostbratwurst';
|
SELECT T2.HomePage FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Thringer Rostbratwurst'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List the first names of the employees who take the orders that ship to the city of "Reims".
|
ship to the city of "Reims" refers to ShipCity = Reims';
|
SELECT DISTINCT T1.FirstName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.ShipCity = 'Reims'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the largest quantity of "Manjimup Dried Apples" for an order?
|
the largest quantity of "Manjimup Dried Apples" refers to MAX(Quantity) where ProductName = 'Manjimup Dried Apples';
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many orders were shipped by "Speedy Express"?
|
"Speedy Express" is the name of the shipping company; orders refer to OrderID;
|
SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Make a list of all the territories in the Southern region.
|
territories in the Southern region refer to TerritoryDescription WHERE RegionDescription = 'Southern';
|
SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the prices on cheese products?
|
prices on cheese refer to UnitPrice WHERE Description = 'Cheeses';
|
SELECT T2.UnitPrice FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.Description = 'Cheeses'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many orders did "Laughing Bacchus Wine Cellars" make?
|
"Laughing Bacchus Wine Cellars" is the name of the company; orders refer to OrderID;
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List all the products that were shipped to Starenweg 5.
|
products shipped to Starenweg 5 refer to ProductName where ShipAddress = 'Starenweg 5';
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the products by the company "Bigfoot Breweries"?
|
Bigfoot Breweries is the name of the company; products refer to ProductName;
|
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Bigfoot Breweries'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the names of Robert King's territories?
|
Robert King is a full name of an employee where LastName = 'King' AND FirstName = 'Robert'; names of territories refer to TerritoryDescription;
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Provide the name of the contact person who made the orders that shipped to Switzerland.
|
shipped to Switzerland refers to ShipCountry = 'Switzerland'; contact person refers to Customers;
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What proportion of orders are taken by the Sales Representative?
|
DIVIDE(COUNT(OrderID where Title = 'Sales Representative'), COUNT(OrderID)) as percentage;
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Among the USA employess, how many of them has PhD title of courtesy?
|
"USA" is the Country; PhD title of courtesy refers to TitleOfCourtesy = 'Dr.'
|
SELECT COUNT(Country) FROM Employees WHERE TitleOfCourtesy = 'Dr.' AND Country = 'USA'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the average salary for employees from ID 1 to 9?
|
ID 1 to 9 refers to EmployeeID BETWEEN 1 AND 9; Average salary = AVG(Salary)
|
SELECT AVG(Salary) FROM Employees WHERE EmployeeID BETWEEN 1 AND 9
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Calculate the total salary for employees from UK.
|
"UK" is the Country; total salary refers to Sum(Salary)
|
SELECT SUM(Salary) FROM Employees WHERE Country = 'UK'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Is (206) 555-1189 the home phone number for Laura Callahan?
|
"Laura Callahan" refers to FirstName = 'Laura AND LastName = 'Callahan
|
SELECT CASE WHEN HomePhone = '(206) 555-1189' THEN 'YES' ELSE 'NO' END FROM Employees WHERE FirstName = 'Laura' AND LastName = 'Callahan'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Write down the notes of employee with the highest salary.
|
highest salary refers to Max(Salary)
|
SELECT Notes FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List down the customer ids who placed order with Michael Suyama.
| null |
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Where are the ship countries of orders placed by Janet Leverling?
| null |
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many orders have Margaret Peacock placed?
| null |
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Calculate the average salary per order for Andrew Fuller.
|
average salary = AVG(Salary)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What are the product names of Exotic Liquids?
|
"Exotic Liquids" is the CompanyName
|
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List down the quantity per unit for products of Tokyo Traders.
|
"Tokyo Traders" is the CompanyName
|
SELECT T1.QuantityPerUnit FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Tokyo Traders'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many products have been discountinued by New Orleans Cajun Delights?
|
"New Orleans Cajun Delights" is the CompanyName; discontinued refers to Discontinued = 1
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Please calculate the average unit price for products of Formaggi Fortini s.r.l.
|
"Formaggi Fortini s.r.l." is the CompanyName; average unit price = AVG(UnitPrice)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Calculate the total products that are supplied by Japan suppliers.
|
Japan Supplier refers to Country = 'Japan'; total product refers to Count (ProductName)
|
SELECT COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the contact name for product Teatime Chocolate Biscuits?
|
"Teatime Chocolate Biscuits" is the ProductName
|
SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Teatime Chocolate Biscuits'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List down the company names that have the highest reorder level.
|
Highest reorder level refers to Max(ReorderLevel)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the contact title for the person who supplied a product that is 10 boxes x 12 pieces.
|
"10 boxes x 12 pieces" is the QuantityPerUnit
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the total units on order from Exotic Liquids?
|
"Exotic Liquids" is the CompanyName; total unit on order = Sum(UnitsOnOrder)
|
SELECT SUM(T1.UnitsOnOrder) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Calculate the percentage of products supplied by Gai pturage over all products.
|
"Gai pturage" is the CompanyName; Percentage = Divide (Count(SupplierID where CompanyName = 'Gai pturage'), Count (SupplierID)) * 100
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List the product ID of the top five products, by descending order, the number of quantities in stock.
|
by descending in number of quantity in stock refers to max(UnitsInStock)
|
SELECT ProductID FROM Products ORDER BY UnitsInStock DESC LIMIT 5
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Among the products, how many of them were discontinued in production?
|
discontinued refers to Discontinued = 1
|
SELECT COUNT(*) FROM Products WHERE Discontinued = 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Give me the address, home phone and salary of the Sales Manager.
|
"Sales Manage" is the Title
|
SELECT Address, HomePhone, Salary FROM Employees WHERE Title = 'Sales Manager'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the full name of the Vice President of Sales. Give me the URL of his/her photo.
|
"Vice Present of Sales" refers to Title = 'Vice President, Sales'; full name refers to FirstName, LastName; url of photo refers to PhotoPath
|
SELECT FirstName, LastName FROM Employees WHERE Title = 'Vice President, Sales'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Write down the top ten companies with the most total sales by amount.
|
most total sales refers to Max(SaleAmount); companies refers to CompanyName
|
SELECT CompanyName FROM `Sales Totals by Amount` ORDER BY SaleAmount DESC LIMIT 10
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the average sales for each categories?
|
average sales = AVG(ProductSales)
|
SELECT AVG(ProductSales) FROM `Sales by Category` GROUP BY CategoryName
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Compute the total order quantity for Uncle Bob's Organic Dried Pears so far.
|
"Uncle Bob's Organic Dried Pears" is the ProductName; total order quantity refers to Sum(Quantity)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Among the seafoods, how many of them have an order quantity of more than 50?
|
"Seafood" is the CategoryName; order quantity of more than 50 refers to Quantity > 50
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
List the products whose supplier is Pavlova, Ltd. Please include the product ID and re-order level.
|
"Pavlova, Ltd" is the CompanyName; products refers to ProductName
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Who are the suppliers of the discontinued products?
|
discontinued product refers to Discontinued = 1; supplier refers to CompanyName
|
SELECT DISTINCT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.Discontinued = 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Among the employees, give me the full names of those who have less than 4 territories.
|
less than 4 territories refers to EmployeeID where Count(TerritoryID) < 4
|
SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.EmployeeID < 4
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many employees have territories in the Eastern region?
|
"Eastern" is the RegionDescription
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
From 1/3/97 to 8/10/97, how many orders were shipped via Federal Shipping?
|
from 1/3/97 to 8/10/97 refers to 1997-03-01 < ShippedDate < 1997-10-08; 'Federal Shipping' is the CompanyName
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Tally the customer ID of orders that were shipped to Brazil by Margaret Peacock from 3/31/97 to 12/10/97.
|
"Brazil" is the ShipCountry; from 3/31/97 to 12/10/97 refers to 1997-03-31 < ShippedDate < 1997-10-12
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the re-order level of products that have an order quantity of 1?
|
order quantity of 1 refers to Quantity = 1
|
SELECT T1.ReorderLevel FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity = 1
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the stock value of every condiments?
|
"Condiments" is the CategoryName; Stock value = MULTIPLY( UnitPrice, UnitInStock)
|
SELECT T1.UnitPrice * T1.UnitsInStock FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many territories are owned by Anne Dodsworth?
| null |
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which of the American customers have experienced a delay in the shipment and how long was the longest?
|
"American" refers to Country = 'USA'; longest delay in shipment refers to Max(Subtract(RequiredDate, ShippedDate)); customer refers to CustomerID
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the contact name and phone number of the customer who has made the most total payment on the order to date?
|
most total payment = Max(Multiply(Quantity, UnitPrice, Subtract(1, Discount)))
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Who is the sales representative of the customer who has made the highest payment? Include the full name of employee and his/her supervisor.
|
highest payment refers to Max(Multiply(Quantity, UnitPrice, Subtract(1, Discount))); full name refers to FirstName, LastName; his/her supervisor refers to 'ReportsTo'
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many customers are there in Berlin, Germany?
|
"Berlin" is the City; 'Germany' is the Country
|
SELECT COUNT(City) FROM Customers WHERE Country = 'Germany' AND City = 'Berlin'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many products does the company Exotic Liquids supply?
|
"Exotic Liquids" is the CompanyName of supplier
|
SELECT COUNT(T1.ProductName) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
Which company has the lowest unit price? Please give the company name and the product name.
|
lowest unit price refers to Min(UnitPrice)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
What is the average unit price of Tokyo Traders' products?
|
"Tokyo Traders" is the CompanyName; average unit price = AVG(UnitPrice)
|
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 name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
retail_world
|
How many territories are there in the Eastern region?
|
"Eastern" is the RegionDescription
|
SELECT COUNT(T1.RegionID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
|
database name:db_id retail_world
Categories table Categories Cols: Category ID dtype integer, Category Name dtype text, Description dtype text,
Customers table Customers Cols: Customer ID dtype integer, Customer Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text,
Employees table Employees Cols: Employee ID dtype integer, Last Name dtype text, First Name dtype text, Birth Date dtype date, Photo dtype text, Notes dtype text,
Shippers table Shippers Cols: Shipper ID dtype integer, Shipper Name dtype text, Phone dtype text,
Suppliers table Suppliers Cols: Supplier ID dtype integer, Supplier Name dtype text, Contact Name dtype text, Address dtype text, City dtype text, Postal Code dtype text, Country dtype text, Phone dtype text,
Products table Products Cols: Product ID dtype integer, Product Name dtype text, Supplier ID dtype integer, Category ID dtype integer, Unit dtype text, Price dtype real,
Orders table Orders Cols: Order ID dtype integer, Customer ID dtype integer, Employee ID dtype integer, Order Date dtype datetime, Shipper ID dtype integer,
OrderDetails table OrderDetails Cols: order detail id dtype integer, Order ID dtype integer, Product ID dtype integer, Quantity dtype integer,
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.