db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
retail_world | select distinct t2.productname from suppliers as t1 inner join products as t2 on t1.supplierid = t2.supplierid inner join `order details` as t3 on t2.productid = t3.productid where t1.companyname = 'tokyo traders' and t3.quantity > 40 | Question: please indicate the product name of tokyo traders company with order quantity greater than 40. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ... | please indicate the product name of tokyo traders company with order quantity greater than 40. |
retail_world | select t3.categoryname from suppliers as t1 inner join products as t2 on t1.supplierid = t2.supplierid inner join categories as t3 on t2.categoryid = t3.categoryid where t2.unitsinstock > 100 and t1.companyname = 'exotic liquids' | Question: list all category name of exotic liquids 's product with units in stock over 100. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippe... | list all category name of exotic liquids 's product with units in stock over 100. |
retail_world | select sum(case when t2.quantity < 50 then 1 else 0 end) , cast(sum(if(t2.quantity < 50, 1, 0)) as real) / count(t1.productid) from products as t1 inner join `order details` as t2 on t1.productid = t2.productid | Question: how many product names have order quantity less than 50? calculate the percentage of orders less than 50 out of total order quantity. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, ... | how many product names have order quantity less than 50? calculate the percentage of orders less than 50 out of total order quantity. |
retail_world | select sum(if(t1.productname = 'geitost', 1, 0)) as sum , cast(sum(if(t1.productname = 'geitost', 1, 0)) as real) / count(t1.productid) from products as t1 inner join `order details` as t2 on t1.productid = t2.productid | Question: please indicate total order quantity of product geitost and calculate the percentage of such product among all the order quantity. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, Las... | please indicate total order quantity of product geitost and calculate the percentage of such product among all the order quantity. |
retail_world | select title from employees where firstname = 'robert' and lastname = 'king' | Question: what is the position of robert king? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Supplier... | what is the position of robert king? |
retail_world | select companyname from shippers where phone = '(503) 555-9931' | Question: write the shipping company name with the telephone number of (503) 555-9931. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ->... | write the shipping company name with the telephone number of (503) 555-9931. |
retail_world | select address, homephone from employees where firstname = 'margaret' and lastname = 'peacock' | Question: write the address and phone number of margaret peacock. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperNa... | write the address and phone number of margaret peacock. |
retail_world | select distinct shipaddress, shipcity, shipregion, shippostalcode, shipcountry from orders where shipname = 'rattlesnake canyon grocery' | Question: what is the full address of rattlesnake canyon grocery? | 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 full address of rattlesnake canyon grocery? |
retail_world | select t1.productname from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t2.categoryname = 'confections' | Question: list all product names under confections. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Sup... | list all product names under confections. |
retail_world | select t2.companyname, t2.contactname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t1.productname like 'sir rodney%s marmalade' | Question: sir rodney's marmalade is supplied by which company and who is the contact for this company? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, No... | sir rodney's marmalade is supplied by which company and who is the contact for this company? |
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 = 'denver' | Question: what is the full name of the employee who is in charge of the territory of denver? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shipp... | what is the full name of the employee who is in charge of the territory of denver? |
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 = 'laura' and t1.lastname = 'callahan' | Question: list all the territories where laura callahan is in charge. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shipp... | list all the territories where laura callahan is in charge. |
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' and t1.shipvia = 3 | Question: how many orders were shipped via federal shipping? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, P... | how many orders were shipped via federal shipping? |
retail_world | select t1.productname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.country = 'finland' | Question: name the products where the suppliers come from finland. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperN... | name the products where the suppliers come from finland. |
retail_world | select t2.categoryname, t2.description from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid where t1.productname = 'mozzarella di giovanni' | Question: the product 'mozzarella di giovanni' belongs in which category? include the category's description as well. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, Birth... | the product 'mozzarella di giovanni' belongs in which category? include the category's description as well. |
retail_world | select distinct t1.companyname from suppliers as t1 inner join products as t2 on t1.supplierid = t2.supplierid inner join categories as t3 on t2.categoryid = t3.categoryid where t3.description = 'cheeses' | Question: name the suppliers that supply products under the category 'cheeses.' | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe... | name the suppliers that supply products under the category 'cheeses.' |
retail_world | select t1.productname from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'zaanse snoepfabriek' | Question: name all products supplied by zaanse snoepfabriek. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, P... | name all products supplied by zaanse snoepfabriek. |
retail_world | select t1.unitprice from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'plutzer lebensmittelgromrkte ag' and t1.discontinued = 1 | Question: which products by plutzer lebensmittelgromrkte ag were discontinued and what are their price? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, N... | which products by plutzer lebensmittelgromrkte ag were discontinued and what are their price? |
retail_world | select t1.shipcity 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 t3.productname = 'mishi kobe niku' | Question: list the cities where the product 'mishi kobe niku' were shipped to. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shipper... | list the cities where the product 'mishi kobe niku' were shipped to. |
retail_world | select cast(count(case when t1.shipcountry = 'sweden' 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 t2.companyname = 'speedy express' | Question: what percentage does the shipment of products by speedy express to sweden make up to the shipping company's total? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName... | what percentage does the shipment of products by speedy express to sweden make up to the shipping company's total? |
retail_world | select count(territoryid) from territories where regionid = 1 | Question: how many territory fall into region 1? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Suppli... | how many territory fall into region 1? |
retail_world | select count(territorydescription) from territories where regionid in (1, 2, 3, 4) group by regionid | Question: what are the the total number of territory in each region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shippe... | what are the the total number of territory in each region? |
retail_world | select count(supplierid) from suppliers where country = 'uk' | Question: how many suppliers are from uk? | 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 -> ... | how many suppliers are from uk? |
retail_world | select contactname from suppliers where companyname = 'tokyo traders' | Question: please give the contact name for tokyo traders. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phon... | please give the contact name for tokyo traders. |
retail_world | select count(country) from employees where country = 'usa' and title = 'sales representative' | Question: how many employees from usa with sales representative title? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Ship... | how many employees from usa with sales representative title? |
retail_world | select salary, title from employees where salary = ( select max(salary) from employees ) | Question: what are the highest salary earn by the the employee and what is his/her position in the company? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Phot... | what are the highest salary earn by the the employee and what is his/her position in the company? |
retail_world | select count(t1.productid) from products as t1 inner join suppliers as t2 on t1.supplierid = t2.supplierid where t2.companyname = 'plutzer lebensmittelgromrkte ag' and t1.unitsinstock = 0 and t1.unitsonorder = 0 | Question: how many products supplied by plutzer lebensmittelgromrkte ag that is currently out of stock and on order? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthD... | how many products supplied by plutzer lebensmittelgromrkte ag that is currently out of stock and on order? |
retail_world | select t1.productname, t2.quantity from products as t1 inner join `order details` as t2 on t1.productid = t2.productid order by t1.unitprice desc limit 1 | Question: what product have the highest unit price and how many quantity have been being sold? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shi... | what product have the highest unit price and how many quantity have been being sold? |
retail_world | select t1.title from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid group by t1.title order by count(t2.orderid) limit 1 | Question: which employee has created the least order and please indicates the employee's title? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Sh... | which employee has created the least order and please indicates the employee's title? |
retail_world | select t2.productid from customers as t1 inner join `order details` as t2 where t1.country = 'germany' group by t2.productid order by count(t2.productid) desc limit 1 | Question: what is the most common product ordered by a customer from germany? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperI... | what is the most common product ordered by a customer from germany? |
retail_world | select sum(t2.quantity * t2.unitprice) from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid inner join shippers as t3 on t1.shipvia = t3.shipperid where t3.companyname = 'speedy express' and t1.shipcountry = 'brazil' | Question: what are the total products value shipped to brazil by speedy express company? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ... | what are the total products value shipped to brazil by speedy express company? |
retail_world | select count(t1.employeeid), sum(t3.quantity * t3.unitprice) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid inner join `order details` as t3 on t2.orderid = t3.orderid where t1.reportsto = 2 order by sum(t3.unitprice * t3.quantity) desc limit 1 | Question: how many subordinates does employee id 2 have and what is the biggest order in terms of value that his/her subordinates have created? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, ... | how many subordinates does employee id 2 have and what is the biggest order in terms of value that his/her subordinates have created? |
retail_world | select sum(t3.unitprice * t3.quantity) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid inner join `order details` as t3 on t2.orderid = t3.orderid where t1.title = 'sales representative' order by sum(t3.unitprice * t3.quantity) | Question: how many sales values have been created by sales representative and which sales representative have the highest sales? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, First... | how many sales values have been created by sales representative and which sales representative have the highest sales? |
retail_world | select count(t1.employeeid), t3.regionid from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid where t1.country = 'uk' group by t3.regionid | Question: how many employees is a uk citizen and are they all covering the same 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 is a uk citizen and are they all covering the same region? |
retail_world | select t1.companyname, t2.shipcountry from customers as t1 inner join orders as t2 on t1.customerid = t2.customerid inner join `order details` as t3 on t2.orderid = t3.orderid group by t1.companyname, t2.shipcountry order by count(t3.productid) desc limit 1 | Question: which customer have the biggest purchase in one order and where does this order being ship to? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, ... | which customer have the biggest purchase in one order and where does this order being ship to? |
retail_world | select t1.customerid, t4.categoryname from orders as t1 inner join `order details` as t2 on t1.orderid = t2.orderid inner join products as t3 on t2.productid = t3.productid inner join categories as t4 on t3.categoryid = t4.categoryid order by t1.customerid desc, t4.categoryname desc | Question: which customer is a regular customer in this shop and what are the products category that he mostly buy? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDat... | which customer is a regular customer in this shop and what are the products category that he mostly buy? |
retail_world | select count(t1.unitprice * t3.quantity) from products as t1 inner join categories as t2 on t1.categoryid = t2.categoryid inner join `order details` as t3 on t1.productid = t3.productid where t2.categoryname = 'confections' group by t3.quantity order by t3.quantity desc limit 1 | Question: what are the most popular confections product and calculate the total sales generated by this product? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate,... | what are the most popular confections product and calculate the total sales generated by this product? |
retail_world | select productname from products where productid = 77 | Question: what is the name of product with the id of 77? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone... | what is the name of product with the id of 77? |
retail_world | select companyname from suppliers where country = 'usa' | Question: state the company name of all suppliers in usa. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phon... | state the company name of all suppliers in usa. |
retail_world | select title from employees where firstname = 'laura' and lastname = 'callahan' | Question: what is the position title for laura callahan? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone... | what is the position title for laura callahan? |
retail_world | select distinct t1.firstname, t1.lastname from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid inner join customers as t3 on t2.customerid = t3.customerid where t3.companyname = 'victuailles en stock' | Question: state the name of employee that manages the order from victuailles en stock? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ->... | state the name of employee that manages the order from victuailles en stock? |
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: how many orders 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, ShipperName, Ph... | how many orders were shipped by federal shipping? |
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 = 'morristown' | Question: who was taking charge of orders from morristown? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Pho... | who was taking charge of orders from morristown? |
retail_world | select distinct t1.territorydescription from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'northern' | Question: state the name of all territories in northern region. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName... | state the name of all territories in northern region. |
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: how many orders were handled by michael suyama. state the order id. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperI... | how many orders were handled by michael suyama. state the order id. |
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 = 'northern' ) as real) * 100 / ( select count(t1.territoryid) from territories as t1 inner join region as t2 on t1.regionid = t2.regionid where t2.regiondescription = 'weste... | Question: what is the ratio number of territories in northern region and number territories in western region? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, P... | what is the ratio number of territories in northern region and number territories in western region? |
retail_world | select employeeid from employeeterritories where territoryid between 1000 and 2000 | Question: provide employees' id who are in-charge of territory id from 1000 to 2000. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> S... | provide employees' id who are in-charge of territory id from 1000 to 2000. |
retail_world | select t3.regionid, t3.territorydescription, t4.regiondescription from employees as t1 inner join employeeterritories as t2 on t1.employeeid = t2.employeeid inner join territories as t3 on t2.territoryid = t3.territoryid inner join region as t4 on t3.regionid = t4.regionid where t1.lastname = 'davolio' and t1.firstname... | Question: list down the territory ids, descriptions and region description which are under the in-charge of nancy davolio, | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, ... | list down the territory ids, descriptions and region description which are under the in-charge of nancy davolio, |
retail_world | select t1.firstname, t1.lastname, count(t2.orderid) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t1.title = 'sales representative' and strftime('%y', t1.hiredate) = '1992' group by t1.employeeid, t1.firstname, t1.lastname | Question: describe sales representative names who were hired in 1992 and compare the number of orders among them. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate... | describe sales representative names who were hired in 1992 and compare the number of orders among them. |
retail_world | select sum(t2.unitprice * t2.quantity * (1 - t2.discount)) as sum from products as t1 inner join `order details` as t2 on t1.productid = t2.productid where t1.productname = 'vegie-spread' | Question: calculate the total payment of orders for vegie-spread product. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, S... | calculate the total payment of orders for vegie-spread product. |
retail_world | select t1.companyname from suppliers as t1 inner join products as t2 on t1.supplierid = t2.supplierid inner join `order details` as t3 on t2.productid = t3.productid inner join orders as t4 on t3.orderid = t4.orderid where date(t4.orderdate) = '1996-08-14' | Question: list down the company names which supplied products for the order on 14th august, 1996. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. ... | list down the company names which supplied products for the order on 14th august, 1996. |
retail_world | select t2.productname, t1.companyname from suppliers as t1 inner join products as t2 on t1.supplierid = t2.supplierid inner join `order details` as t3 on t2.productid = t3.productid where t3.orderid = 10337 order by t2.reorderlevel desc limit 1 | Question: among the product lists in order id 10337, write down the product names and suppliers which had the highest in reorder level. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName... | among the product lists in order id 10337, write down the product names and suppliers which had the highest in reorder level. |
retail_world | select t1.companyname from shippers as t1 inner join orders as t2 on t1.shipperid = t2.shipvia where strftime('%y', t2.shippeddate) = '1998' group by t1.companyname order by count(t2.orderid) desc limit 1 | Question: name the shipper which had the most shipments in first quarter of 1998. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Ship... | name the shipper which had the most shipments in first quarter of 1998. |
retail_world | select count(customerid) from customers where city = 'london' | Question: how many customers are located in london? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Sup... | how many customers are located in london? |
retail_world | select title from employees where firstname = 'michael' and lastname = 'suyama' | Question: what is the title of michael suyama? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone. Supplier... | what is the title of michael suyama? |
retail_world | select firstname, lastname from employees where birthdate = '1955-03-04 00:00:00' | Question: list out the full name of employee who has birth day on '3/4/1955 12:00:00 am'. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers... | list out the full name of employee who has birth day on '3/4/1955 12:00:00 am'. |
retail_world | select t1.firstname, t1.lastname from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderid = 10250 | Question: mention the first name of employee who took care the order id 10250. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shipper... | mention the first name of employee who took care the order id 10250. |
retail_world | select count(t2.orderid) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t1.city = 'tacoma' | Question: how many orders that the employees who are located in tacoma handled? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shippe... | how many orders that the employees who are located in tacoma handled? |
retail_world | select t1.country from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderid = 10257 | Question: what is the country location of the employee who handled order id 10257? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shi... | what is the country location of the employee who handled order id 10257? |
retail_world | select t1.title from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderid = 10257 | Question: what is the title of the employee who handled order id 10270? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Shi... | what is the title of the employee who handled order id 10270? |
retail_world | select t1.phone from customers as t1 inner join orders as t2 on t1.customerid = t2.customerid where t2.orderid = 10264 | Question: give the phone number of the customer who placed the order id 10264. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shipper... | give the phone number of the customer who placed the order id 10264. |
retail_world | select t1.region from customers as t1 inner join orders as t2 on t1.customerid = t2.customerid where t2.orderid = 10276 | Question: what is the region where the customer who placed the order id 10276 located? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers ->... | what is the region where the customer who placed the order id 10276 located? |
retail_world | select t1.firstname, t1.lastname, avg(t1.salary) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.shipcountry = 'brazil' group by t1.firstname, t1.lastname order by sum(t1.salary) desc limit 1 | Question: among the employees who handled orders to brazil, who has the highest salary and calculate the average salary of them. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, First... | among the employees who handled orders to brazil, who has the highest salary and calculate the average salary of them. |
retail_world | select cast(sum(case when strftime('%y', t2.shippeddate) = '1996' then t1.salary else 0 end) as real) * 100 / sum(t1.salary) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid | Question: calculate the percentage salary of employees who handled orders shipped in 1996. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shipper... | calculate the percentage salary of employees who handled orders shipped in 1996. |
retail_world | select t1.hiredate from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderid = 10281 | Question: when was the employee who handled order id 10281 hired? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperNa... | when was the employee who handled order id 10281 hired? |
retail_world | select count(t2.orderid) from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t1.reportsto = 5 | Question: how many orders was handled by employees who reported to employee id 5? | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Ship... | how many orders was handled by employees who reported to employee id 5? |
retail_world | select t1.firstname, t1.lastname from employees as t1 inner join orders as t2 on t1.employeeid = t2.employeeid where t2.orderid = 10280 | Question: give the full name of employee who handled the order id 10280. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, Sh... | give the full name of employee who handled the order id 10280. |
retail_world | select t2.companyname from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.orderid = 10260 | Question: state the shipping company of order id 10260. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> ShipperID, ShipperName, Phone.... | state the shipping company of order id 10260. |
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: how many orders have been shipped through 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 have been shipped through united package? |
retail_world | select t2.phone from orders as t1 inner join shippers as t2 on t1.shipvia = t2.shipperid where t1.orderid = 10260 | Question: list out the phone number of the shipping company of order id 10296. | Tables: Categories -> CategoryID, CategoryName, Description. Customers -> CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. Employees -> EmployeeID, LastName, FirstName, BirthDate, Photo, Notes. Shippers -> Shipper... | list out the phone number of the shipping company of order id 10296. |
retails | select count(l_linenumber) from lineitem where l_orderkey = 5 and l_returnflag = 'r' | Question: how many kinds of items are returned in order no.5? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, ... | how many kinds of items are returned in order no.5? |
retails | select max(l_shipdate) from lineitem where l_orderkey = 1 | Question: when was the latest date the items of order no.1 were shipped? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_c... | when was the latest date the items of order no.1 were shipped? |
retails | select l_orderkey from lineitem where l_orderkey in (4, 36) order by l_shipdate desc limit 1 | Question: which order has a higher priority, order no. 4 or order no. 36? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_... | which order has a higher priority, order no. 4 or order no. 36? |
retails | select o_comment from orders where o_totalprice = ( select max(o_totalprice) from orders ) | Question: what is the comment of the order with the highest total price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_c... | what is the comment of the order with the highest total price? |
retails | select c_phone from customer where c_name = 'customer#000000001' | Question: what is the phone number of customer#000000001? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_re... | what is the phone number of customer#000000001? |
retails | select count(t1.o_orderkey) from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t2.c_mktsegment = 'household' | Question: how many orders in total have the customers in the household segment made? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus... | how many orders in total have the customers in the household segment made? |
retails | select max(t1.o_totalprice) from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t2.c_mktsegment = 'household' | Question: among all the orders made by a customer in the household segment, what is the highest total price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag,... | among all the orders made by a customer in the household segment, what is the highest total price? |
retails | select t1.o_comment from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t2.c_mktsegment = 'household' | Question: please list the order comments of all the orders made by customers in the household segment. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_par... | please list the order comments of all the orders made by customers in the household segment. |
retails | select t2.c_name from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey order by t1.o_totalprice desc limit 1 | Question: please give the name of the customer who has made the single order with the highest total price. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l... | please give the name of the customer who has made the single order with the highest total price. |
retails | select t1.o_orderkey from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t2.c_acctbal < 0 | Question: please list the order keys of all the orders made by a customer whose account is in debt. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partke... | please list the order keys of all the orders made by a customer whose account is in debt. |
retails | select count(t1.o_orderpriority) from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t2.c_mktsegment = 'household' and t1.o_orderpriority = '1-urgent' | Question: among the orders made by customers in the household segment, how many of them are urgent? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partke... | among the orders made by customers in the household segment, how many of them are urgent? |
retails | select count(t1.c_custkey) from customer as t1 inner join nation as t2 on t1.c_nationkey = t2.n_nationkey where t2.n_name = 'brazil' | Question: how many customers are in brazil? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate, l_s... | how many customers are in brazil? |
retails | select t1.c_phone from customer as t1 inner join nation as t2 on t1.c_nationkey = t2.n_nationkey where t1.c_mktsegment = 'household' and t2.n_name = 'brazil' | Question: please list the phone numbers of all the customers in the household segment and are in brazil. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_p... | please list the phone numbers of all the customers in the household segment and are in brazil. |
retails | select count(t1.c_custkey) from customer as t1 inner join nation as t2 on t1.c_nationkey = t2.n_nationkey where t2.n_name = 'germany' and t1.c_acctbal > 1000 | Question: among all the customers in germany, how many of them have an account balance of over 1000? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partk... | among all the customers in germany, how many of them have an account balance of over 1000? |
retails | select count(t2.c_custkey) from nation as t1 inner join customer as t2 on t1.n_nationkey = t2.c_nationkey inner join orders as t3 on t2.c_custkey = t3.o_custkey where t1.n_name = 'germany' | Question: how many orders in total are made by customers in germany? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commi... | how many orders in total are made by customers in germany? |
retails | select sum(t3.o_totalprice) from nation as t1 inner join customer as t2 on t1.n_nationkey = t2.c_nationkey inner join orders as t3 on t2.c_custkey = t3.o_custkey where t1.n_name = 'germany' | Question: what is the total price of all the orders made by customers in germany? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l... | what is the total price of all the orders made by customers in germany? |
retails | select t3.o_orderkey from nation as t1 inner join customer as t2 on t1.n_nationkey = t2.c_nationkey inner join orders as t3 on t2.c_custkey = t3.o_custkey where t1.n_name = 'germany' order by t3.o_orderdate limit 1 | Question: among the orders made by customers in germany, which one of them has the highest priority in delivery? please give its order key. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_sup... | among the orders made by customers in germany, which one of them has the highest priority in delivery? please give its order key. |
retails | select avg(t3.o_totalprice) from nation as t1 inner join customer as t2 on t1.n_nationkey = t2.c_nationkey inner join orders as t3 on t2.c_custkey = t3.o_custkey where t1.n_name = 'germany' | Question: what is the average price of the orders made by a customer in germany? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_... | what is the average price of the orders made by a customer in germany? |
retails | select cast(sum(iif(t2.n_name = 'germany', 1, 0)) as real) * 100 / count(t1.c_custkey) from customer as t1 inner join nation as t2 on t1.c_nationkey = t2.n_nationkey | Question: among all the customers, what is the percentage of the customer's nation being germany? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey,... | among all the customers, what is the percentage of the customer's nation being germany? |
retails | select count(n_nationkey) from nation where n_regionkey = 2 | Question: how many countries are there in the no.2 region? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_r... | how many countries are there in the no.2 region? |
retails | select t2.n_name from supplier as t1 inner join nation as t2 on t1.s_nationkey = t2.n_nationkey where t1.s_suppkey = 34 | Question: which country does supplier no.34 come from? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_recei... | which country does supplier no.34 come from? |
retails | select t3.r_name from nation as t1 inner join supplier as t2 on t1.n_nationkey = t2.s_nationkey inner join region as t3 on t1.n_regionkey = t3.r_regionkey where t2.s_name = 'supplier#000000129' | Question: which region does 'supplier#000000129' belong to? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_... | which region does 'supplier#000000129' belong to? |
retails | select t2.n_name from customer as t1 inner join nation as t2 on t1.c_name = 'customer#000000055' | Question: what is the nationality of 'customer#000000055'? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_r... | what is the nationality of 'customer#000000055'? |
retails | select t3.r_name from nation as t1 inner join customer as t2 on t1.n_nationkey = t2.c_nationkey inner join region as t3 on t1.n_regionkey = t3.r_regionkey where t2.c_custkey = 106936 | Question: give customer no.106936's region name. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate... | give customer no.106936's region name. |
retails | select count(t1.c_name) from customer as t1 inner join nation as t2 on t1.c_nationkey = t2.n_nationkey where t2.n_name = 'morocco' and t1.c_acctbal < 0 | Question: give the number of moroccan customers whose account is in debt. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_... | give the number of moroccan customers whose account is in debt. |
retails | select t1.l_extendedprice * (1 - t1.l_discount) as discounterprice from lineitem as t1 inner join orders as t2 on t2.o_orderkey = t1.l_orderkey where t1.l_suppkey = 9397 and t2.o_totalprice = 231499.38 | Question: for the order with the total price of 231499.38, what was the discounted price for supplier no. 9397? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnfl... | for the order with the total price of 231499.38, what was the discounted price for supplier no. 9397? |
retails | select t2.l_suppkey from orders as t1 inner join lineitem as t2 on t1.o_orderkey = t2.l_orderkey where t1.o_totalprice = 218195.43 and t2.l_returnflag = 'r' | Question: for the order with the total price of 218195.43, which supplier handled the returned item? give the supplier id. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity,... | for the order with the total price of 218195.43, which supplier handled the returned item? give the supplier id. |
retails | select t2.l_extendedprice * (1 - t2.l_discount) * (1 + t2.l_tax) as num from orders as t1 inner join lineitem as t2 on t1.o_orderkey = t2.l_orderkey where t1.o_clerk = 'clerk#000000936' and t2.l_shipmode = 'truck' and t1.o_orderstatus = '4-not specified' and t1.o_orderdate = '1995-03-13' | Question: clerk#000000936 dealt with a 'not specified' order on 1995/3/13, what was the charge for the part of the order shipped by truck? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_supp... | clerk#000000936 dealt with a 'not specified' order on 1995/3/13, what was the charge for the part of the order shipped by truck? |
retails | select julianday(t2.l_receiptdate) - julianday(t2.l_commitdate) from orders as t1 inner join lineitem as t2 on t1.o_orderkey = t2.l_orderkey where t1.o_custkey = '129301' and t1.o_orderdate = '1996-07-27' | Question: customer no.129301 made an order on 1996/7/27, what was the delivery time for the first part of that order? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_re... | customer no.129301 made an order on 1996/7/27, what was the delivery time for the first part of that order? |
retails | select t2.c_name from orders as t1 inner join customer as t2 on t1.o_custkey = t2.c_custkey where t1.o_orderdate = '1997-12-10' and t1.o_clerk = 'clerk#000000803' | Question: give the name of the customer who made an order with clerk#000000803 on 1997/12/10. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_l... | give the name of the customer who made an order with clerk#000000803 on 1997/12/10. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.