db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
retail_world
select count(employeeid) from employees where reportsto = ( select employeeid from employees where lastname = 'fuller' and firstname = 'andrew' )
Question: how many employees have andrew fuller as their direct supervisor? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID,...
how many employees have andrew fuller as their direct supervisor?
retail_world
select firstname, lastname from employees where salary = ( select max(salary) from employees )
Question: which employee has the highest salary? please give his or her full name. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shi...
which employee has the highest salary? please give his or her full name.
retail_world
select ( select salary from employees where lastname = 'fuller' and firstname = 'andrew' ) - ( select salary from employees where lastname = 'davolio' and firstname = 'nancy' ) as result
Question: how much higher is the salary of andrew fuller than that of nancy davolio? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> S...
how much higher is the salary of andrew fuller than that of nancy davolio?
retail_world
select count(country) from employees where title = 'sales representative' and country = 'uk'
Question: among the employees working as sales representatives, how many of them are located in the uk? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, N...
among the employees working as sales representatives, how many of them are located in the uk?
retail_world
select t1.firstname, t1.lastname from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid where t3.territorydescription = 'hollis'
Question: which employee is in charge of the sales in hollis? please give the employee's full name. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes...
which employee is in charge of the sales in hollis? please give the employee's full name.
retail_world
select count(t2.territoryid) from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid where t1.firstname = 'nancy' and t1.lastname = 'davolio'
Question: the sales of how many territories is nancy davolio in charge of? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ...
the sales of how many territories is nancy davolio in charge of?
retail_world
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.firstname = 'nancy' and t1.lastname = 'davolio'
Question: please list the names of all the territories whose sales are taken in charge by nancy davolio. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ...
please list the names of all the territories whose sales are taken in charge by nancy davolio.
retail_world
select count(t2.territoryid) from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid where t1.city = 'london'
Question: the sales of how many territories in total do the employees in london take charge of? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Sh...
the sales of how many territories in total do the employees in london take charge of?
retail_world
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.reportsto = ( select employeeid from employees where firstname = 'andrew' and lastname = 'fuller' )
Question: please list the territories whose sales are taken in charge by the employees who report to andrew fuller. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDa...
please list the territories whose sales are taken in charge by the employees who report to andrew fuller.
retail_world
select count(counteid) from ( select t1.employeeid as counteid from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid where t1.country = 'uk' group by t1.employeeid having count(t2.territoryid) > 4 ) t1
Question: how many employees in the uk takes charge of the sales in over 4 territories? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -...
how many employees in the uk takes charge of the sales in over 4 territories?
retail_world
select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'eastern'
Question: how many territories are there in the eastern region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName...
how many territories are there in the eastern region?
retail_world
select distinct t1.territorydescription from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'eastern'
Question: please list all the territories in the eastern region. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperNam...
please list all the territories in the eastern region.
retail_world
select count(t.employeeid) from ( select t3.employeeid from region as t1 inner join territories as t2 on t1.regionid = t2.regionid inner join employeeterritories as t3 on t2.territoryid = t3.territoryid where t1.regiondescription = 'eastern' group by t3.employeeid ) t
Question: how many employees in total are in charge of the sales in the eastern region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -...
how many employees in total are in charge of the sales in the eastern region?
retail_world
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 inner join region as t4 on t3.regionid = t4.regionid where t4.regiondescription = 'eastern ' group by t1.homephone
Question: please list the home phone numbers of the employees who are in charge of the sales in the territories in the eastern region. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName,...
please list the home phone numbers of the employees who are in charge of the sales in the territories in the eastern region.
retail_world
select ( select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'eastern' ) - ( select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'southern' ) as calu
Question: how many more territories are there in than eastern region than in the southern region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. ...
how many more territories are there in than eastern region than in the southern region?
retail_world
select t1.productname from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10248
Question: please list the names of all the products ordered in order no. 10248. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe...
please list the names of all the products ordered in order no. 10248.
retail_world
select t2.quantity from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10273 and t1.productname = 'ikura'
Question: what is the quantity of ikura ordered in order no. 10273? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipper...
what is the quantity of ikura ordered in order no. 10273?
retail_world
select t2.unitprice * t2.quantity from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10273 and t1.productname = 'ikura'
Question: what is the total price of ikura ordered in order no. 10273? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Ship...
what is the total price of ikura ordered in order no. 10273?
retail_world
select t1.unitsinstock + t1.unitsonorder from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10248 order by t2.quantity desc limit 1
Question: what is the total production of the product that is ordered in the highest quantity in order no. 10248? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate...
what is the total production of the product that is ordered in the highest quantity in order no. 10248?
retail_world
select t1.productname from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10248 order by t1.reorderlevel desc limit 1
Question: of all the products ordered in order no. 10248, which product has the highest user satisfaction? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo...
of all the products ordered in order no. 10248, which product has the highest user satisfaction?
retail_world
select count(t2.orderid) from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t1.productname = 'tofu'
Question: how many orders have asked for the product tofu? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Pho...
how many orders have asked for the product tofu?
retail_world
select t2.orderid from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t1.discontinued = 1
Question: please list the ids of the orders with a product whose production is not continuous. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shi...
please list the ids of the orders with a product whose production is not continuous.
retail_world
select count(t2.orderid) from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t1.productname = 'ikura' and t2.unitprice < t1.unitprice
Question: of all the orders that have ordered ikura, how many of them enjoys a unit price that's lower than its standard unit price? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, F...
of all the orders that have ordered ikura, how many of them enjoys a unit price that's lower than its standard unit price?
retail_world
select t2.companyname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.productname = 'aniseed syrup'
Question: what is the name of the supplier company for aniseed syrup? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipp...
what is the name of the supplier company for aniseed syrup?
retail_world
select t1.productname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.country = 'japan'
Question: please list the names of all the products whose supplier is in japan. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe...
please list the names of all the products whose supplier is in japan.
retail_world
select distinct t2.phone from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.unitsinstock < t1.unitsonorder
Question: please list the phone numbers of the suppliers of the products that have a higher units on order than units in stock. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstN...
please list the phone numbers of the suppliers of the products that have a higher units on order than units in stock.
retail_world
select count(t1.discontinued) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.country = 'usa' and t1.discontinued = 1
Question: among the products that are no longer in continuous production, how many of them have their supplier in the usa? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, ...
among the products that are no longer in continuous production, how many of them have their supplier in the usa?
retail_world
select t2.companyname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.unitprice = ( select max(unitprice) from products )
Question: who is the supplier of the product with the highest unit price? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, S...
who is the supplier of the product with the highest unit price?
retail_world
select avg(t1.salary) from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid group by t1.employeeid having count(t2.territoryid) > 4
Question: what is the average salary of the employees who takes charge of the sales of over 4 territories? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo...
what is the average salary of the employees who takes charge of the sales of over 4 territories?
retail_world
select cast((t1.unitprice - t2.unitprice) as real) * 100 / t1.unitprice from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10273 and t1.productname = 'ikura'
Question: how much lower in percentage is the unit price of ikura in order no. 10273 than its standard unit price? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDat...
how much lower in percentage is the unit price of ikura in order no. 10273 than its standard unit price?
retail_world
select cast(sum(t2.quantity) as real) / count(t2.orderid) from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t1.productname = 'ikura'
Question: what is the average quantity of ikura ordered in one order? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipp...
what is the average quantity of ikura ordered in one order?
retail_world
select t1.productname from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.orderid = 10248 order by t1.unitsonorder / t1.unitsinstock desc limit 1
Question: among the products ordered in order no. 10248, which product has the biggest ratio of units on order to units in stock? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, Firs...
among the products ordered in order no. 10248, which product has the biggest ratio of units on order to units in stock?
retail_world
select firstname, lastname from employees where birthdate = ( select max(birthdate) from employees )
Question: give the full name of the youngest employee. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. ...
give the full name of the youngest employee.
retail_world
select firstname, lastname from employees where hiredate = ( select max(hiredate) from employees )
Question: who is the newest hired employee? give the full name. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName...
who is the newest hired employee? give the full name.
retail_world
select count(t2.orderid) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t1.firstname = 'michael' and t1.lastname = 'suyama'
Question: provide the number of orders that were handled by michael suyama. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID,...
provide the number of orders that were handled by michael suyama.
retail_world
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.titleofcourtesy = 'mr.' and t1.firstname = 'robert' and t1.lastname = 'king'
Question: give the name of the territory where mr. robert king works. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipp...
give the name of the territory where mr. robert king works.
retail_world
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.employeeid = ( select reportsto from employees where titleofcourtesy = 'ms.' and firstname = 'laura' and lastname = 'callahan...
Question: which territory does ms. laura callahan's direct supervisor work in? give the name of the territory. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, P...
which territory does ms. laura callahan's direct supervisor work in? give the name of the territory.
retail_world
select t1.firstname, t1.lastname from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid where t3.territorydescription = 'santa monica'
Question: who is in charge of the 'santa monica' territory? give the full name. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe...
who is in charge of the 'santa monica' territory? give the full name.
retail_world
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 = 'savannah'
Question: give the home phone number of the employee who is in charge of 'savannah' territory. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shi...
give the home phone number of the employee who is in charge of 'savannah' territory.
retail_world
select sum(t2.quantity) from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid where t1.customerid = 'hilaa' and t1.orderdate like '1997-12-25%'
Question: for the order from 'hilaa' on 1997/12/25, what was the total quantity of the products in that order? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, P...
for the order from 'hilaa' on 1997/12/25, what was the total quantity of the products in that order?
retail_world
select count(t2.productid) from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid where t1.freight = ( select max(freight) from orders ) group by t1.orderid
Question: for the order paying the highest freight, how many kinds of products does it contain? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Sh...
for the order paying the highest freight, how many kinds of products does it contain?
retail_world
select t2.companyname from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.orderid = 10585
Question: tell the name of the shipper company for the order no.10585. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Ship...
tell the name of the shipper company for the order no.10585.
retail_world
select count(t1.orderid) from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t2.companyname = 'federal shipping'
Question: give the number of orders that were shipped by 'federal shipping'. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID...
give the number of orders that were shipped by 'federal shipping'.
retail_world
select count(t1.productid) from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t2.categoryname = 'dairy products'
Question: how many kinds of products are there in the the category of 'dairy products'? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -...
how many kinds of products are there in the the category of 'dairy products'?
retail_world
select t2.categoryname from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t1.productname = 'tofu'
Question: which category does 'tofu' belong to? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Supplie...
which category does 'tofu' belong to?
retail_world
select sum(t1.unitsinstock + t1.unitsonorder) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'escargots nouveaux'
Question: what is the total production of the products from the supplier escargots nouveaux? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shipp...
what is the total production of the products from the supplier escargots nouveaux?
retail_world
select t1.reorderlevel from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'nord-ost-fisch handelsgesellschaft mbh'
Question: give the reorder level for the products from the supplier 'nord-ost-fisch handelsgesellschaft mbh'. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Ph...
give the reorder level for the products from the supplier 'nord-ost-fisch handelsgesellschaft mbh'.
retail_world
select count(t1.productid) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'karkki oy'
Question: how many kinds of products are supplied by 'karkki oy' company? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, S...
how many kinds of products are supplied by 'karkki oy' company?
retail_world
select t2.contactname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.productname = 'gudbrandsdalsost'
Question: give the contact name of the supplier for the product 'gudbrandsdalsost'. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Sh...
give the contact name of the supplier for the product 'gudbrandsdalsost'.
retail_world
select t2.country from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.productname = 'scottish longbreads'
Question: tell the country name of the supplier for 'scottish longbreads'. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ...
tell the country name of the supplier for 'scottish longbreads'.
retail_world
select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'northern'
Question: give the number of territories in the 'northern' region. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperN...
give the number of territories in the 'northern' region.
retail_world
select t2.regiondescription from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t1.territorydescription = 'columbia'
Question: which region is 'columbia' in? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Suppliers -> S...
which region is 'columbia' in?
retail_world
select cast(count(case when t2.companyname = 'united package' then 1 else null end) as real) * 100 / count(t1.orderid) from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.customerid = 'whitc'
Question: for the orders of customer 'whitc', what is the percentage of the orders were fulfilled with shipper company 'united package'? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastNam...
for the orders of customer 'whitc', what is the percentage of the orders were fulfilled with shipper company 'united package'?
retail_world
select cast((count(case when t2.companyname = 'united package' then 1 else null end) - count(case when t2.companyname = 'speedy express' then 1 else null end)) as real) * 100 / count(case when t2.companyname = 'speedy express' then 1 else null end) from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperi...
Question: how many percent more orders were fulfilled with shipper company 'united package' than with 'speedy express'? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, Bir...
how many percent more orders were fulfilled with shipper company 'united package' than with 'speedy express'?
retail_world
select cast(( select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'eastern' ) as real) / ( select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'southern' ) ...
Question: how many times is the number of territories in 'eastern region' than 'southern region'? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. ...
how many times is the number of territories in 'eastern region' than 'southern region'?
retail_world
select count(customerid) from customers group by country order by count(customerid) desc limit 1
Question: how many customers are there in the country with the highest number of customers? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippe...
how many customers are there in the country with the highest number of customers?
retail_world
select orderid from orders where freight > 800
Question: what are the order ids of the orders with freight of over 800? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Sh...
what are the order ids of the orders with freight of over 800?
retail_world
select address, city, region, country, postalcode from customers where companyname = 'island trading'
Question: what is the island trading customer's complete address? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperNa...
what is the island trading customer's complete address?
retail_world
select productname from products where unitprice = ( select max(unitprice) from products )
Question: what is the most expensive product? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Suppliers...
what is the most expensive product?
retail_world
select count(supplierid) from suppliers where country = 'usa'
Question: how many suppliers are there in the united states of america? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shi...
how many suppliers are there in the united states of america?
retail_world
select productname from products where reorderlevel = ( select max(reorderlevel) from products )
Question: which product have the highest user satisfaction? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Ph...
which product have the highest user satisfaction?
retail_world
select firstname, lastname from employees where salary = ( select max(salary) from employees )
Question: what is the full name of the employee with the highest salary? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Sh...
what is the full name of the employee with the highest salary?
retail_world
select productname from products where discontinued = 1
Question: what are the names of the products that were discountinued? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipp...
what are the names of the products that were discountinued?
retail_world
select avg(salary) from employees where title = 'sales representative' and country = 'uk'
Question: what is the average salary of sales representatives in the united kingdom? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> S...
what is the average salary of sales representatives in the united kingdom?
retail_world
select t2.companyname from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.shipcountry = 'usa' group by t2.companyname order by count(t2.companyname) desc limit 1
Question: what is the most widely used shipping company in the united states of america? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ...
what is the most widely used shipping company in the united states of america?
retail_world
select count(t1.productname) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'pavlova, ltd.'
Question: how many products were supplied by pavlova, ltd.? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Ph...
how many products were supplied by pavlova, ltd.?
retail_world
select count(t1.orderid) from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.customerid = 'greal' and t2.companyname = 'united package'
Question: how many orders were shipped to greal via united package? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipper...
how many orders were shipped to greal via united package?
retail_world
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 )
Question: what are the names of the suppliers whose products have the highest user satisfaction? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. S...
what are the names of the suppliers whose products have the highest user satisfaction?
retail_world
select count(t1.orderid) from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t2.companyname = 'united package'
Question: in total, how many orders were shipped via united package? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shippe...
in total, how many orders were shipped via united package?
retail_world
select count(t1.discontinued) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.discontinued = 1 and t2.country = 'australia'
Question: how many suppliers in australia whose products were discontinued? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID,...
how many suppliers in australia whose products were discontinued?
retail_world
select t2.unitprice * t2.quantity + t1.freight from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid order by t2.unitprice * t2.quantity + t1.freight desc limit 2
Question: how much is the total purchase price, including freight, of the top 2 most expensive products? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ...
how much is the total purchase price, including freight, of the top 2 most expensive products?
retail_world
select t1.supplierid from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid group by t1.supplierid order by count(*) desc limit 1
Question: what is the name of the supplier that supplies the most products to the company? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shipper...
what is the name of the supplier that supplies the most products to the company?
retail_world
select distinct t1.productname from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t2.unitprice < 5
Question: what are the names of the products that were ordered that have a unit price of no more than 5? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ...
what are the names of the products that were ordered that have a unit price of no more than 5?
retail_world
select t1.title from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid group by t1.title order by count(t2.territoryid) desc limit 1
Question: what is the title of the employee with the highest number of territories in charge? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Ship...
what is the title of the employee with the highest number of territories in charge?
retail_world
select t1.productid from products as t1 inner join `order details` as t2 on t1.productid = t2.productid group by t1.productid order by count(*) desc limit 1
Question: what is the most ordered products by customers? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phon...
what is the most ordered products by customers?
retail_world
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.titleofcourtesy = 'dr.'
Question: which territories is the employee with a doctorate in charge of? list all of the territory descriptions. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDat...
which territories is the employee with a doctorate in charge of? list all of the territory descriptions.
retail_world
select distinct t1.territorydescription from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'eastern' order by t1.territorydescription
Question: what are the territory descriptions of territories in the eastern region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Sh...
what are the territory descriptions of territories in the eastern region?
retail_world
select cast(count(t2.territoryid) as real) / count(distinct t1.employeeid) from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid where t1.title = 'sales representative'
Question: what is the average number of territories do each sales representative is in charge of? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. ...
what is the average number of territories do each sales representative is in charge of?
retail_world
select t1.productname from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t2.categoryname = 'beverages' order by t1.reorderlevel desc limit 1
Question: among the beverages, which product has the highest customer satisfaction? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Sh...
among the beverages, which product has the highest customer satisfaction?
retail_world
select t1.firstname, t1.lastname from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid group by t1.firstname, t1.lastname order by count(*) desc limit 1
Question: what is the full name of the employee who handled the highest amount of orders? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers...
what is the full name of the employee who handled the highest amount of orders?
retail_world
select count(t2.productid) from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid group by t2.productid order by count(t1.freight) desc limit 1
Question: how many products were ordered in the order with the highest freight? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe...
how many products were ordered in the order with the highest freight?
retail_world
select t1.productname from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t2.categoryname = 'seafood' order by t1.unitsinstock + t1.unitsonorder desc limit 1
Question: among the seafood products, which product have the highest total production of the production? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ...
among the seafood products, which product have the highest total production of the production?
retail_world
select max(salary) - min(salary) from ( select t1.salary from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid group by t1.employeeid, t1.salary order by count(t2.territoryid) desc limit 2 ) t1
Question: what is the difference in salary of the top 2 employees with the highest number of territories in charge? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDa...
what is the difference in salary of the top 2 employees with the highest number of territories in charge?
retail_world
select sum(unitprice) / count(unitprice) from products where unitsinstock > 50
Question: what is the average price of products with more than fifty units in stock? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> S...
what is the average price of products with more than fifty units in stock?
retail_world
select companyname from `customer and suppliers by city` where city = ( select city from `customer and suppliers by city` group by city order by count(relationship) desc limit 1 )
Question: list the company names of customers from the city with the most customers. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> S...
list the company names of customers from the city with the most customers.
retail_world
select companyname, contactname, contacttitle from customers where city = 'madrid'
Question: find and list the company name, company contact name, and contact title of customers from madrid. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Phot...
find and list the company name, company contact name, and contact title of customers from madrid.
retail_world
select firstname, lastname, homephone from employees order by birthdate desc
Question: give the full name and contact number of employees in descending order of age. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ...
give the full name and contact number of employees in descending order of age.
retail_world
select avg(unitprice) as avg from invoices where country = 'uk'
Question: calculate the average price of products shipped to the uk. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shippe...
calculate the average price of products shipped to the uk.
retail_world
select productid from `order details` group by productid order by sum(quantity) desc limit 1
Question: among all the orders, which products sold for the most amount? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Sh...
among all the orders, which products sold for the most amount?
retail_world
select t2.companyname, t2.address, t2.phone from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.unitprice > 30
Question: list the name, address, and phone number of companies that supply products for more than thirty dollars per unit. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName,...
list the name, address, and phone number of companies that supply products for more than thirty dollars per unit.
retail_world
select distinct t1.companyname, t1.address from customers as t1 inner join orders as t2 on t1.customerid = t2.customerid where t2.freight > ( select avg(freight) from orders )
Question: among the customers, list customers' company names and addresses who paid more than average in freight. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate...
among the customers, list customers' company names and addresses who paid more than average in freight.
retail_world
select t1.firstname, t1.lastname from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid where t3.territorydescription = 'wilton'
Question: find and list the full name of employees who are from the territory, wilton. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ->...
find and list the full name of employees who are from the territory, wilton.
retail_world
select distinct t2.companyname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.discontinued = 1 and t2.country != 'usa'
Question: list the names of non-us suppliers that have discontinued. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shippe...
list the names of non-us suppliers that have discontinued.
retail_world
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.orderdate like '1998%' order by t3.unitprice + t1.freight desc limit 5
Question: list the top five most costly products in 1998. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phon...
list the top five most costly products in 1998.
retail_world
select count(t3.customerid) from shippers as t1 inner join orders as t2 on t1.shipperid = t2.shipvia inner join customers as t3 on t2.customerid = t3.customerid where t2.shipname = 'federal shipping'
Question: of the customers who are from canada, how many used federal shipping? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe...
of the customers who are from canada, how many used federal shipping?
retail_world
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 group by t3.productname order by count(*) desc limit 10
Question: list the name of the top ten most ordered product's names in descending order of the number of orders. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate,...
list the name of the top ten most ordered product's names in descending order of the number of orders.
retail_world
select t2.companyname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid group by t2.supplierid, t2.companyname order by count(t1.productname) desc limit 1
Question: which supplier supplies the most amount of products? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName,...
which supplier supplies the most amount of products?
retail_world
select distinct t1.firstname, t1.lastname, t4.regiondescription from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid inner join region as t4 on t3.regionid = t4.regionid order by t1.firstname
Question: please list the full name and region of each employee in alphabetical order. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ->...
please list the full name and region of each employee in alphabetical order.
retail_world
select firstname, lastname, title, address from employees where employeeid = ( select t1.employeeid from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderdate between '1996-01-01 00:00:00' and '1997-01-01 00:00:00' group by t1.employeeid order by count(t2.orderid) desc limit 1 )
Question: which employee handled the most amount of orders in 1996? give the full name, title, and address of this employee. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName...
which employee handled the most amount of orders in 1996? give the full name, title, and address of this employee.
retail_world
select avg(t2.unitprice) from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid inner join shippers as t3 on t1.shipvia = t3.shipperid where t1.orderdate like '1997%' and t3.companyname = 'united package'
Question: what was the average unit price of products shipped via united package in 1997? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers...
what was the average unit price of products shipped via united package in 1997?