db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
works_cycles | select t1.name, t2.startdate from product as t1 inner join productcosthistory as t2 on t1.productid = t2.productid where t2.enddate is null | Question: for all the products, list the product name and its corresponding start date for the current standard cost. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curr... | for all the products, list the product name and its corresponding start date for the current standard cost. |
works_cycles | select t1.name from product as t1 inner join productcosthistory as t2 on t1.productid = t2.productid where t1.standardcost - t2.standardcost > 80 group by t1.name | Question: list the products whereby the standard cost is $80 more than previous standard cost in history. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mo... | list the products whereby the standard cost is $80 more than previous standard cost in history. |
works_cycles | select t1.name, t2.quantity from product as t1 inner join shoppingcartitem as t2 on t1.productid = t2.productid where t2.shoppingcartid = 14951 | Question: name all products and total quantity for each item for shopping cart id 14951. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Perso... | name all products and total quantity for each item for shopping cart id 14951. |
works_cycles | select t1.name from product as t1 inner join shoppingcartitem as t2 on t1.productid = t2.productid where t2.quantity > 5 | Question: list the product name with more than 5 quantity in the shopping cart. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busi... | list the product name with more than 5 quantity in the shopping cart. |
works_cycles | select distinct t1.name from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t1.class = 'l' and t2.transactiontype = 'p' order by t1.name | Question: for all the purchase order transactions, name all the products with low quality. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Per... | for all the purchase order transactions, name all the products with low quality. |
works_cycles | select distinct t1.name, t1.listprice from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t2.quantity > 10000 | Question: provide all the transactions whereby the quantiy is more than 10,000 pieces. state the product name and the selling price. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryR... | provide all the transactions whereby the quantiy is more than 10,000 pieces. state the product name and the selling price. |
works_cycles | select t1.name from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t1.class = 'h' order by t2.quantity asc limit 1 | Question: which is a high quality product but with the lowest transacted quantity? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> B... | which is a high quality product but with the lowest transacted quantity? |
works_cycles | select count(t2.transactionid) from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t1.productline = 'm' | Question: how many transactions are there for product under the mountain line? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busin... | how many transactions are there for product under the mountain line? |
works_cycles | select sum((t1.listprice - t1.standardcost) * t2.quantity) from product as t1 inner join shoppingcartitem as t2 on t1.productid = t2.productid where t2.shoppingcartid = 20621 | Question: how much would be the total sales profit for shopping cart id 20621 ? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busi... | how much would be the total sales profit for shopping cart id 20621 ? |
works_cycles | select name, listprice from product where class = 'h' | Question: list all product names that are high in quality. please also state its selling price. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate... | list all product names that are high in quality. please also state its selling price. |
works_cycles | select productline from product where finishedgoodsflag = 1 group by productline order by count(finishedgoodsflag) desc limit 1 | Question: which product line has the most products that are salable? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityI... | which product line has the most products that are salable? |
works_cycles | select productid, rating, comments from productreview where reviewername like 'j%' | Question: provide details of review from reviewer whose name begin with letter 'j'. state the product id, rating and comments. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionC... | provide details of review from reviewer whose name begin with letter 'j'. state the product id, rating and comments. |
works_cycles | select t1.name, t1.productline, t2.rating, t1.listprice from product as t1 inner join productreview as t2 on t1.productid = t2.productid order by t2.rating asc limit 1 | Question: state the product name, product line, rating and the selling price of product with the lowest rating. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCo... | state the product name, product line, rating and the selling price of product with the lowest rating. |
works_cycles | select distinct name from product where listprice - standardcost > 100 | Question: calculate the profit of each products. list all products with more than $100 in profit. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDa... | calculate the profit of each products. list all products with more than $100 in profit. |
works_cycles | select t1.name, t2.reviewername, t2.rating, t2.comments from product as t1 inner join productreview as t2 using (productid) where t1.productline = 'r' | Question: list down the product name, reviewer name, rating and comments for product under the road line. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mo... | list down the product name, reviewer name, rating and comments for product under the road line. |
works_cycles | select count(t1.productid), avg(t2.rating) from product as t1 inner join productreview as t2 on t1.productid = t2.productid where t1.name = 'hl mountain pedal' | Question: how many people reviewed for product named hl mountain pedal? what is the average rating? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modified... | how many people reviewed for product named hl mountain pedal? what is the average rating? |
works_cycles | select t1.name from product as t1 inner join purchaseorderdetail as t2 on t1.productid = t2.productid where t2.rejectedqty = t2.receivedqty and t2.rejectedqty <> 0 | Question: list the purchase order whereby all received quantity were rejected? name those product. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedD... | list the purchase order whereby all received quantity were rejected? name those product. |
works_cycles | select t1.name, t2.unitprice from product as t1 inner join purchaseorderdetail as t2 on t1.productid = t2.productid where t2.rejectedqty = 0 order by t2.linetotal desc limit 1 | Question: among all products without any rejected quantity, which product has the highest line total? state the product name and unit price. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> ... | among all products without any rejected quantity, which product has the highest line total? state the product name and unit price. |
works_cycles | select t1.name, t1.productline from product as t1 inner join purchaseorderdetail as t2 on t1.productid = t2.productid where t2.orderqty > 4999 | Question: list all product names and its product line for all purchase order with order quantity of 5000 or more. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Currency... | list all product names and its product line for all purchase order with order quantity of 5000 or more. |
works_cycles | select sum(t2.orderqty) from product as t1 inner join purchaseorderdetail as t2 on t1.productid = t2.productid where t1.productline = 't' | Question: what is the total ordered quantity for products under the 'touring' line? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> ... | what is the total ordered quantity for products under the 'touring' line? |
works_cycles | select t1.name, t2.linetotal from product as t1 inner join purchaseorderdetail as t2 on t1.productid = t2.productid where class = 'l' order by orderqty * unitprice desc limit 1 | Question: among the low quality product, which product has the highest line total? list the product name and its line total? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCod... | among the low quality product, which product has the highest line total? list the product name and its line total? |
works_cycles | select t1.name from product as t1 inner join productvendor as t2 on t1.productid = t2.productid order by t2.lastreceiptcost - t2.standardprice desc limit 1 | Question: which product has the highest profit on net? state the product name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busin... | which product has the highest profit on net? state the product name. |
works_cycles | select distinct t1.name from product as t1 inner join productvendor as t2 on t1.productid = t2.productid where t2.minorderqty = 100 order by t1.name desc | Question: list all products with minimum order quantity of 100 and order them by product name in descending order. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Currenc... | list all products with minimum order quantity of 100 and order them by product name in descending order. |
works_cycles | select t1.name, t1.listprice - t1.standardcost from product as t1 inner join productreview as t2 on t1.productid = t2.productid order by t2.rating desc limit 1 | Question: list the name and calculate its profit for product with the highest rating in review. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate... | list the name and calculate its profit for product with the highest rating in review. |
works_cycles | select sum((t1.listprice - t1.standardcost) * t2.quantity) from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t1.productid = 827 | Question: what is the total profit all transactions with product id 827? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | what is the total profit all transactions with product id 827? |
works_cycles | select fromcurrencycode, tocurrencycode from currencyrate order by averagerate desc limit 1 | Question: which currency pair's average exchange rate for the day is the highest? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bu... | which currency pair's average exchange rate for the day is the highest? |
works_cycles | select orderqty from purchaseorderdetail order by unitprice desc limit 1 | Question: how many products with the highest unit price were ordered? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntity... | how many products with the highest unit price were ordered? |
works_cycles | select name from salesterritory where countryregioncode = 'us' and (name = 'northwest' or name = 'southeast') order by saleslastyear desc limit 1 | Question: between northwest and southeast of the united states, which territory one recorded the highest amount of sales last year? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRe... | between northwest and southeast of the united states, which territory one recorded the highest amount of sales last year? |
works_cycles | select t1.firstname, t1.middlename, t1.lastname from person as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid inner join document as t3 on t3.owner = t2.businessentityid where t2.jobtitle = 'document control manager' and t3.documentlevel = 1 and t3.status = 2 group by t1.firstname, t1.middlen... | Question: what is the full name of the document control manager who is in charge of all level 1 approved documents? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curren... | what is the full name of the document control manager who is in charge of all level 1 approved documents? |
works_cycles | select t1.customerid from salesorderheader as t1 inner join salesperson as t2 on t1.salespersonid = t2.businessentityid order by t1.subtotal desc limit 1 | Question: which customer has the highest subtotal amount of sales orders whose assigned to the salesperson with the highest bonus? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryReg... | which customer has the highest subtotal amount of sales orders whose assigned to the salesperson with the highest bonus? |
works_cycles | select t2.unitprice * t2.orderqty from specialoffer as t1 inner join salesorderdetail as t2 on t1.specialofferid = t2.specialofferid where t1.description = 'volume discount 11 to 14' and t1.specialofferid = 2 and t2.productid = 716 and t2.salesorderid = 46625 | Question: what is the total price of sales order id 46625 with volume discount 11 to 14 and product id 716? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ... | what is the total price of sales order id 46625 with volume discount 11 to 14 and product id 716? |
works_cycles | select count(t1.productid) from product as t1 inner join billofmaterials as t2 on t1.productid = t2.productassemblyid where t1.makeflag = 1 and t1.daystomanufacture = 1 and t2.bomlevel = 4 and t1.reorderpoint <= 600 | Question: of the products that has a reorder inventory point of no more than 600, how many manufactured in-house products that takes 1 day to manufacture with bom level 4 are there? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name... | of the products that has a reorder inventory point of no more than 600, how many manufactured in-house products that takes 1 day to manufacture with bom level 4 are there? |
works_cycles | select t2.bonus from salesterritory as t1 inner join salesperson as t2 on t1.territoryid = t2.territoryid where t1.countryregioncode = 'ca' order by t2.salesquota desc limit 1 | Question: what is the highest amount of bonus earned by the sales person in canada? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> ... | what is the highest amount of bonus earned by the sales person in canada? |
works_cycles | select t2.name from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t1.rating = ( select rating from productreview order by rating asc limit 1 ) | Question: what are the names of the product that has the lowest rating? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnti... | what are the names of the product that has the lowest rating? |
works_cycles | select count(t2.businessentityid) from department as t1 inner join employeedepartmenthistory as t2 on t1.departmentid = t2.departmentid where t2.startdate >= '2009-01-01' and t2.startdate < '2010-01-01' and t1.name = 'production' | Question: how many of the workers who started working in 2009 are from the production department? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDa... | how many of the workers who started working in 2009 are from the production department? |
works_cycles | select t3.firstname, t3.middlename, t3.lastname, t1.jobtitle from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid inner join person as t3 on t2.businessentityid = t3.businessentityid where t1.maritalstatus = 's' and t1.gender = 'f' order by t2.rate desc limit 1 | Question: who is the company's highest-paid single female employee? include her full name and job title. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mod... | who is the company's highest-paid single female employee? include her full name and job title. |
works_cycles | select t2.firstname, t2.middlename, t2.lastname, t1.hiredate from employee as t1 inner join person as t2 using (businessentityid) where t1.jobtitle = 'vice president of engineering' | Question: who is the vice president of engineering and when did he join the company? indicate his/her full name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyC... | who is the vice president of engineering and when did he join the company? indicate his/her full name. |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.currentflag = 1 and t2.rate <= 30 | Question: how many active employees whose payrate is equal or below 30 per hour. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bus... | how many active employees whose payrate is equal or below 30 per hour. |
works_cycles | select t1.name from department as t1 inner join employeedepartmenthistory as t2 on t1.departmentid = t2.departmentid order by t2.startdate desc limit 1 | Question: which department has a worker who just recently started working? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessE... | which department has a worker who just recently started working? |
works_cycles | select t2.firstname, t2.middlename, t2.lastname, t1.gender from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.persontype = 'sp' | Question: which store sales person was reently hired? indicate his/her full name and gender. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. P... | which store sales person was reently hired? indicate his/her full name and gender. |
works_cycles | select t2.payfrequency from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid order by t1.sickleavehours asc limit 1 | Question: how frequently do the employee with the least number of sick leave hours get paid? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. P... | how frequently do the employee with the least number of sick leave hours get paid? |
works_cycles | select t1.jobtitle from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid order by t2.rate asc limit 1 | Question: which job title has the lowest pay? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, NameStyl... | which job title has the lowest pay? |
works_cycles | select count(t2.businessentityid) from department as t1 inner join employeedepartmenthistory as t2 using (departmentid) where t1.name = 'finance' | Question: what is the total number of employees that worked in the finance department? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person ... | what is the total number of employees that worked in the finance department? |
works_cycles | select ( select listprice - standardcost from product where listprice != 0 order by listprice desc limit 1 ) , ( select listprice - standardcost from product where listprice != 0 order by listprice limit 1 ) | Question: what is the profit of the product with the highest list price and of the product with the lowest list price other than 0? indicates the depth the component is from its parent. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, ... | what is the profit of the product with the highest list price and of the product with the lowest list price other than 0? indicates the depth the component is from its parent. |
works_cycles | select t2.name, t1.lastreceiptcost - t1.standardprice from productvendor as t1 inner join vendor as t2 on t1.businessentityid = t2.businessentityid where t2.creditrating = 3 | Question: among the companies to which adventure works cycles purchases parts or other goods, what is the profit on net obtained from the vendor who has an above average credit rating? kindly indicate each names of the vendor and the corresponding net profits. | Tables: CountryRegion -> CountryRegionCode, Name, Modifie... | among the companies to which adventure works cycles purchases parts or other goods, what is the profit on net obtained from the vendor who has an above average credit rating? kindly indicate each names of the vendor and the corresponding net profits. |
works_cycles | select count(*) from address where addressline2 <> '' | Question: how many accounts have an address that is too long? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Pers... | how many accounts have an address that is too long? |
works_cycles | select postalcode from address order by modifieddate desc limit 1 | Question: what is the postal code of the street address of the account that is latest updated? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate.... | what is the postal code of the street address of the account that is latest updated? |
works_cycles | select julianday(enddate) - julianday(startdate) from billofmaterials order by julianday(enddate) - julianday(startdate) desc limit 1 | Question: what is the longest assembly item duration for bicycles? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID,... | what is the longest assembly item duration for bicycles? |
works_cycles | select count(billofmaterialsid) from billofmaterials where enddate is null | Question: how many assembly items for bicycles aren't finished? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Pe... | how many assembly items for bicycles aren't finished? |
works_cycles | select unitmeasurecode from billofmaterials order by perassemblyqty desc limit 1 | Question: please list the unit measure code of the component that is of the greatest need in quantity to create the assembly. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCo... | please list the unit measure code of the component that is of the greatest need in quantity to create the assembly. |
works_cycles | select count(documentnode) from document where documentsummary is null | Question: how many product maintenance documents are private? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Pers... | how many product maintenance documents are private? |
works_cycles | select title from document where status = 1 | Question: please list the titles of the documents that are pending approval. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busines... | please list the titles of the documents that are pending approval. |
works_cycles | select distinct t2.businessentityid, t2.jobtitle from document as t1 inner join employee as t2 on t1.owner = t2.businessentityid where t1.status = 2 | Question: please list the job titles of the employees who has a document that has been approved. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDat... | please list the job titles of the employees who has a document that has been approved. |
works_cycles | select t1.payfrequency from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid order by t2.birthdate asc limit 1 | Question: what is the pay frequency of the oldest employee? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Person... | what is the pay frequency of the oldest employee? |
works_cycles | select count(t1.businessentityid) from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.maritalstatus = 'm' and t1.payfrequency = ( select payfrequency from employeepayhistory order by payfrequency desc limit 1 ) | Question: among the employees whose pay frequencies are the highest, how many of them are married? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedD... | among the employees whose pay frequencies are the highest, how many of them are married? |
works_cycles | select t1.rate from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid order by t2.hiredate desc limit 1 | Question: for the employee who has been hired the latest, what is his or her pay rate? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person ... | for the employee who has been hired the latest, what is his or her pay rate? |
works_cycles | select sum(case when t2.gender = 'm' then 1 else 0 end) from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t1.rate > 40 | Question: among the employees who have a pay rate of above 40, how many of them are male? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Pers... | among the employees who have a pay rate of above 40, how many of them are male? |
works_cycles | select t1.rate from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.salariedflag = 1 order by t1.rate desc limit 1 | Question: what is the highest pay rate of the employees who are exempt from collective bargaining? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedD... | what is the highest pay rate of the employees who are exempt from collective bargaining? |
works_cycles | select t2.vacationhours from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.businessentityid = ( select businessentityid from employeepayhistory order by rate desc limit 1 ) | Question: for the employees who have the highest pay frequency, please list their vacation hours. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDa... | for the employees who have the highest pay frequency, please list their vacation hours. |
works_cycles | select t1.rate from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid order by t2.vacationhours desc limit 1 | Question: what is the pay rate of the employee who has the longest vacation hours? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> B... | what is the pay rate of the employee who has the longest vacation hours? |
works_cycles | select count(t1.businessentityid) from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.sickleavehours > 10 and t1.rate > 35 | Question: how many employees with a pay rate of over 35 have more than 10 sick leave hours? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Pe... | how many employees with a pay rate of over 35 have more than 10 sick leave hours? |
works_cycles | select count(t1.businessentityid) from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.currentflag = 1 and t2.gender = 'm' and t1.payfrequency = 2 | Question: among the active male employees, how many of them are paid with the highest frequency? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDat... | among the active male employees, how many of them are paid with the highest frequency? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.gender = 'm' and t2.persontype = 'sp' | Question: how many male employees have the job position of sales person? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | how many male employees have the job position of sales person? |
works_cycles | select t2.persontype from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid order by t1.birthdate asc limit 1 | Question: what is the job position of the oldest employee? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonT... | what is the job position of the oldest employee? |
works_cycles | select t2.namestyle from employeepayhistory as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.rate is not null order by t1.rate asc limit 1 | Question: what is the name style of the employee with the lowest pay rate? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessE... | what is the name style of the employee with the lowest pay rate? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.namestyle = 0 and t1.maritalstatus = 'm' | Question: among the employees who are married, how many of them have a western name style? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Per... | among the employees who are married, how many of them have a western name style? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.emailpromotion = 1 and t1.sickleavehours > 10 | Question: among the employees who have more than 10 hours of sick leave, how many of them wish to receive e-mail promotions? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCod... | among the employees who have more than 10 hours of sick leave, how many of them wish to receive e-mail promotions? |
works_cycles | select t1.businessentityid from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.emailpromotion = 1 and t1.vacationhours > 20 | Question: please list the employees who have more than 20 vacations hours and wish to receive e-mail promotions. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyC... | please list the employees who have more than 20 vacations hours and wish to receive e-mail promotions. |
works_cycles | select t2.additionalcontactinfo from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where persontype = 'sp' order by t1.birthdate asc limit 1 | Question: please give the additional contact information of the oldest employee with the jod position of sales person. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Cur... | please give the additional contact information of the oldest employee with the jod position of sales person. |
works_cycles | select t2.firstname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.namestyle = 0 and t1.gender = 'm' | Question: what is the first name of the male employee who has a western name style? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> ... | what is the first name of the male employee who has a western name style? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.currentflag = 1 and t2.title = 'mr.' | Question: among the active employees, how many of them have a courtesy title of 'mr'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -... | among the active employees, how many of them have a courtesy title of 'mr'? |
works_cycles | select t2.demographics from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid inner join employeepayhistory as t3 on t2.businessentityid = t3.businessentityid where t1.maritalstatus = 'm' order by t3.rate desc limit 1 | Question: please give the personal information of the married employee who has the highest pay rate. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modifie... | please give the personal information of the married employee who has the highest pay rate. |
works_cycles | select t2.suffix from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.persontype = 'sp' order by t1.sickleavehours desc limit 1 | Question: what is the surname suffix of the employee who works as a store contact and has the longest sick leave hours? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Cu... | what is the surname suffix of the employee who works as a store contact and has the longest sick leave hours? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid inner join employeepayhistory as t3 on t2.businessentityid = t3.businessentityid where t1.maritalstatus = 'm' and t2.namestyle = 1 and t3.rate = ( select rate from employeepayhistory order by rate ... | Question: among the married employees with the highest pay frequency, how many of them have an eastern name style? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Currenc... | among the married employees with the highest pay frequency, how many of them have an eastern name style? |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.currentflag = 1 and t2.emailpromotion = 1 | Question: how many active employees do not wish to receive e-mail promotions? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busine... | how many active employees do not wish to receive e-mail promotions? |
works_cycles | select t2.creditcardid from person as t1 inner join personcreditcard as t2 on t1.businessentityid = t2.businessentityid where t1.persontype = 'sc' | Question: please list the credit card ids of the employees who work as store contact. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -... | please list the credit card ids of the employees who work as store contact. |
works_cycles | select cast(sum(t1.vacationhours) as real) / count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.gender = 'm' and t2.persontype = 'em' | Question: how many vacation hours do the male employees have on average? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | how many vacation hours do the male employees have on average? |
works_cycles | select max(t1.rate) - sum(t1.rate) / count(t1.businessentityid) from employeepayhistory as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid inner join employee as t3 on t2.businessentityid = t3.businessentityid where t2.emailpromotion = 2 and t3.maritalstatus = 'm' | Question: among the employees who are married and wish to receive e-mail promotions, how much higher is their highest pay rate from the average pay rate? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegio... | among the employees who are married and wish to receive e-mail promotions, how much higher is their highest pay rate from the average pay rate? |
works_cycles | select cast(count(iif(t1.persontype = 'sc', t1.persontype, null)) as real) / count(t1.persontype) from person as t1 inner join employee as t2 where t1.persontype = 'sc' and t1.namestyle = 0 and t2.maritalstatus = 'm' | Question: if a married employee has a western name style, what is the probability of him or her working as a store contact? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode... | if a married employee has a western name style, what is the probability of him or her working as a store contact? |
works_cycles | select cast(sum(case when t2.vacationhours > 20 then 1 else 0 end) as real) * 100 / count(t1.businessentityid) from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t2.currentflag = 1 and t2.sickleavehours > 10 | Question: among the active employees with over 10 hours of sick leave, what is the percentage of the employees with over 20 vacation hours? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> C... | among the active employees with over 10 hours of sick leave, what is the percentage of the employees with over 20 vacation hours? |
works_cycles | select sum(lastreceiptcost) / count(productid) from productvendor where averageleadtime = 60 | Question: average of the last receipt cost of the products whose average lead time is 60 days. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate.... | average of the last receipt cost of the products whose average lead time is 60 days. |
works_cycles | select cast(sum(actualcost) as real) / count(transactionid) from transactionhistoryarchive where transactiontype = 'p' and transactiondate >= '2012-01-01' and transactiondate < '2012-07-01' | Question: average cost of purchase orders made during the first six months of 2012. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> ... | average cost of purchase orders made during the first six months of 2012. |
works_cycles | select cast(sum(case when maritalstatus = 'm' then 1 else 0 end) as real) * 100 / count(businessentityid) from employee where substr(hiredate, 1, 4) = '2009' and gender = 'm' | Question: what percentage of male employees hired throughout the years 2009 are married? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Perso... | what percentage of male employees hired throughout the years 2009 are married? |
works_cycles | select cast(sum(case when emailpromotion = 2 then 1 else 0 end) as real) * 100 / sum(case when persontype = 'sc' then 1 else 0 end) from person where firstname = 'mary' | Question: what percentage of people named mary who wants receive email promotions of adventureworks and selected partners are store contacts? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency ->... | what percentage of people named mary who wants receive email promotions of adventureworks and selected partners are store contacts? |
works_cycles | select distinct productid from productvendor where standardprice - lastreceiptcost < 0 | Question: list, by productid, all products whose profit, relative to the standard price, is negative. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modifi... | list, by productid, all products whose profit, relative to the standard price, is negative. |
works_cycles | select sum(totaldue) / count(totaldue) from purchaseorderheader where status = 2 | Question: what is the average total due price of products with approved status? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busi... | what is the average total due price of products with approved status? |
works_cycles | select cast(sum(case when orderqty < 3 and unitpricediscount = 0.2 then 1 else 0 end) as real) / count(salesorderid) from salesorderdetail | Question: what is the percentage, by number of sales order units, for orders with quantities not greater than 3 and a discount of 0.2? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> Countr... | what is the percentage, by number of sales order units, for orders with quantities not greater than 3 and a discount of 0.2? |
works_cycles | select businessentityid from salesperson where salesytd > saleslastyear + saleslastyear * 0.6 and bonus > 3000 | Question: lists all companies by businessentityid that increased their current year sales by more than 60% over last year's sales and have a bonus greater than 3,000. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate.... | lists all companies by businessentityid that increased their current year sales by more than 60% over last year's sales and have a bonus greater than 3,000. |
works_cycles | select sum(case when t2.name = 'home' then 1 else 0 end) , sum(case when t2.name = 'shipping' then 1 else 0 end) from businessentityaddress as t1 inner join addresstype as t2 on t1.addresstypeid = t2.addresstypeid | Question: add the number of businesses that indicate their home address as their address and those whose address corresponds to the shipping address. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCur... | add the number of businesses that indicate their home address as their address and those whose address corresponds to the shipping address. |
works_cycles | select t2.customerid from salesorderdetail as t1 inner join customer as t2 where t1.unitprice = 35 and t1.orderqty = 32 | Question: identifies the id number of the customer whose sales order for 32 units had a unit price of 35. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mo... | identifies the id number of the customer whose sales order for 32 units had a unit price of 35. |
works_cycles | select t2.businessentityid from creditcard as t1 inner join personcreditcard as t2 on t1.creditcardid = t2.creditcardid where t1.cardtype = 'colonialvoice' and t1.expmonth = 3 and t1.expyear = 2005 | Question: what company has a colonial voice card that expired in march 2005? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busines... | what company has a colonial voice card that expired in march 2005? |
works_cycles | select t2.creditrating from productvendor as t1 inner join vendor as t2 on t1.businessentityid = t2.businessentityid where t1.standardprice = 18.9900 and t1.averageleadtime = 16 and strftime('%y-%m-%d', t1.lastreceiptdate) = '2011-08-27' | Question: what is the credit rating of the company whose average lead time is 16 days for a standard price of 18.9900 and whose last receipt date is august 27, 2011? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. ... | what is the credit rating of the company whose average lead time is 16 days for a standard price of 18.9900 and whose last receipt date is august 27, 2011? |
works_cycles | select count(productid) from product where name like '%accessories %' or name like '%components%' | Question: calculate the number of products if we add the products of the accessories and components categories. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCo... | calculate the number of products if we add the products of the accessories and components categories. |
works_cycles | select t1.jobtitle from employee as t1 inner join employeedepartmenthistory as t2 on t1.businessentityid = t2.businessentityid where t2.departmentid = 12 order by t2.startdate desc limit 1 | Question: what is the job title of the newest employee in department 12? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | what is the job title of the newest employee in department 12? |
works_cycles | select t2.firstname, t2.lastname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.maritalstatus = 's' and t1.gender = 'm' and t1.jobtitle like 'production supervisor%' | Question: list the first and last name of all unmarried male production supervisors. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person ->... | list the first and last name of all unmarried male production supervisors. |
works_cycles | select count(t1.locationid) from location as t1 inner join productinventory as t2 using (locationid) where t1.name = 'subassembly' | Question: how many products are there if we add all those located in the subassembly category? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate.... | how many products are there if we add all those located in the subassembly category? |
works_cycles | select sum(t2.scrappedqty) from scrapreason as t1 inner join workorder as t2 on t1.scrapreasonid = t2.scrapreasonid where t1.name = 'trim length too long' | Question: sum the total number of products rejected for having a trim length that is too long. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate.... | sum the total number of products rejected for having a trim length that is too long. |
works_cycles | select sum(t2.orderqty) from purchaseorderheader as t1 inner join purchaseorderdetail as t2 on t1.purchaseorderid = t2.purchaseorderid where t1.status = 1 | Question: calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> ... | calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status. |
works_cycles | select count(distinct t1.productid) from salesorderdetail as t1 inner join specialofferproduct as t2 on t1.specialofferid = t2.specialofferid inner join specialoffer as t3 on t2.specialofferid = t3.specialofferid where t1.orderqty > 2 and t1.unitpricediscount = 0 | Question: if we discount the products that do not have any type of offer, how many different products have been sold in an amount greater than 2 units per order? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. Coun... | if we discount the products that do not have any type of offer, how many different products have been sold in an amount greater than 2 units per order? |
works_cycles | select distinct t2.transactiontype from product as t1 inner join transactionhistory as t2 on t1.productid = t2.productid where t1.size = 62 and t1.color = 'yellow' and t1.safetystocklevel = 500 | Question: what type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryReg... | what type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.