db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
works_cycles | select t3.emailaddress from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid inner join emailaddress as t3 on t2.businessentityid = t3.businessentityid where t1.gender = 'f' and t1.maritalstatus = 's' | Question: list down the email address of female single employees. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, ... | list down the email address of female single employees. |
works_cycles | select t1.color from product as t1 inner join productreview as t2 on t1.productid = t2.productid where t1.productid = 709 or 937 or 798 | Question: what are the color of products that were reviewed? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Perso... | what are the color of products that were reviewed? |
works_cycles | select sum(t1.salesquota) from salesperson as t1 inner join salespersonquotahistory as t2 on t1.businessentityid = t2.businessentityid where t1.businessentityid = 275 and strftime('%y', quotadate) = '2013' | Question: what is the projected sales quota amount in 2013 and sales ytd amount for sales person with business entity id 275? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCo... | what is the projected sales quota amount in 2013 and sales ytd amount for sales person with business entity id 275? |
works_cycles | select distinct t1.businessentityid from salesperson as t1 inner join salespersonquotahistory as t2 on t1.businessentityid = t2.businessentityid where strftime('%y', t2.quotadate) = '2013' and t1.salesquota < t1.saleslastyear | Question: provide the business entity id who did not achieved projected yearly sales quota in 2013. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modified... | provide the business entity id who did not achieved projected yearly sales quota in 2013. |
works_cycles | select cast(sum(case when t1.gender = 'f' then 1 else 0 end) as real) * 100 / count(t1.businessentityid) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.emailpromotion = 1 | Question: among the employees who wish to receive e-mail promotion from adventureworks, how many percent of them are female? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCod... | among the employees who wish to receive e-mail promotion from adventureworks, how many percent of them are female? |
works_cycles | select cast(sum(case when t1.maritalstatus = 'm' then 1 else 0 end) as real) * 100 / sum(case when t1.maritalstatus = 's' then 1 else 0 end) from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t2.persontype = 'em' | Question: how many times is married non sales employees against single non-sales employees? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Pe... | how many times is married non sales employees against single non-sales employees? |
works_cycles | select sum(t1.bonus) , cast(sum(t1.bonus) as real) * 100 / sum(t1.salesquota) from salesperson as t1 inner join salespersonquotahistory as t2 on t1.businessentityid = t2.businessentityid where strftime('%y', t2.quotadate) = '2013' | Question: how much is the total bonus received by sales person and what is the percentage of it against the projected yearly sales quota in 2013? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrenc... | how much is the total bonus received by sales person and what is the percentage of it against the projected yearly sales quota in 2013? |
works_cycles | select count(cardnumber) from creditcard where cardtype = 'vista' | Question: how many types of credit cards are there and how many are vista? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessE... | how many types of credit cards are there and how many are vista? |
works_cycles | select name from product where productid = 475 | Question: what is the name of the product with the id '475'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Perso... | what is the name of the product with the id '475'? |
works_cycles | select count(businessentityid) from employee where maritalstatus = 's' and birthdate < '1980-1-1' | Question: among the employees born before 1980 , how many of them are single? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busine... | among the employees born before 1980 , how many of them are single? |
works_cycles | select name from store where salespersonid = 277 | Question: list all the names of the stores assigned to the sales person with the id '277'. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Per... | list all the names of the stores assigned to the sales person with the id '277'. |
works_cycles | select sum(quantity) from transactionhistory where transactiondate like '2013-08%' and transactiontype = 's' and productid = 989 | Question: how many products with the id '989' were sold in august 2013? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnti... | how many products with the id '989' were sold in august 2013? |
works_cycles | select cardnumber from creditcard where expyear < 2007 | Question: list all of the credit cards that had expired by 2007. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, P... | list all of the credit cards that had expired by 2007. |
works_cycles | select t2.rate from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where strftime('%y', t1.hiredate) - strftime('%y', t1.birthdate) = 20 | Question: list all the pay rates of all employees that were hired at 20 years of age. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -... | list all the pay rates of all employees that were hired at 20 years of age. |
works_cycles | select t2.name from salesperson as t1 inner join salesterritory as t2 on t1.territoryid = t2.territoryid where t1.businessentityid = 277 | Question: what is the name of the territory assigned to the sales person with business id '277'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDat... | what is the name of the territory assigned to the sales person with business id '277'? |
works_cycles | select t2.firstname, t2.middlename, t2.lastname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.jobtitle = 'vice president of production' | Question: what is the full name of the vice president of production? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityI... | what is the full name of the vice president of production? |
works_cycles | select count(t2.businessentityid) from department as t1 inner join employeedepartmenthistory as t2 on t1.departmentid = t2.departmentid inner join shift as t3 on t2.shiftid = t3.shiftid where t1.name = 'information services' and t3.name = 'evening' | Question: how many employees in the information service department work the evening shift? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Per... | how many employees in the information service department work the evening shift? |
works_cycles | select t2.purchaseorderid from vendor as t1 inner join purchaseorderheader as t2 on t1.businessentityid = t2.vendorid where t1.creditrating = 5 | Question: list all the purchase order ids of the vendor with a below average rating. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person ->... | list all the purchase order ids of the vendor with a below average rating. |
works_cycles | select t2.name from personphone as t1 inner join phonenumbertype as t2 on t1.phonenumbertypeid = t2.phonenumbertypeid where t1.phonenumber = '114-555-0100' | Question: is the phone number '114-555-0100' a work number or a home number? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busines... | is the phone number '114-555-0100' a work number or a home number? |
works_cycles | select sum(t2.freight) from shipmethod as t1 inner join purchaseorderheader as t2 on t1.shipmethodid = t2.shipmethodid where t1.name = 'cargo transport 5' and t2.orderdate = '2011-12-14' | Question: what is the total shipment by 'cargo transport 5' cost of all purchase orders created on 12/14/2011? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCod... | what is the total shipment by 'cargo transport 5' cost of all purchase orders created on 12/14/2011? |
works_cycles | select count(t2.totaldue) from person as t1 inner join salesorderheader as t2 on t1.modifieddate = t2.duedate where t1.firstname = 'david' and t1.middlename = 'r' and t1.lastname = 'campbell' and t1.persontype = 'sp' | Question: how many sales orders did the salesperson david r. campbell create? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busine... | how many sales orders did the salesperson david r. campbell create? |
works_cycles | select t3.emailaddress from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid inner join emailaddress as t3 on t2.businessentityid = t3.businessentityid where t1.jobtitle = 'facilities manager' | Question: what is the email address of the facilities manager? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Per... | what is the email address of the facilities manager? |
works_cycles | select count(t2.customerid) from salesterritory as t1 inner join customer as t2 on t1.territoryid = t2.territoryid where t1.name = 'canada' | Question: how many customers are there in canada? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, Name... | how many customers are there in canada? |
works_cycles | select t1.shiptoaddressid from salesorderheader as t1 inner join address as t2 on t1.billtoaddressid = t2.addressid where t1.salesorderid = 43873 group by t1.shiptoaddressid | Question: what is the shipping address for the sales order '43873'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID... | what is the shipping address for the sales order '43873'? |
works_cycles | select t2.firstname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.sickleavehours > 65 | Question: list the first names of the people with more than 65 sick leave hours. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bus... | list the first names of the people with more than 65 sick leave hours. |
works_cycles | select count(t1.businessentityid) from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.jobtitle like 'production technician%' and t2.rate < ( select avg(t2.rate) from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid ... | Question: among all the production technicians, how many have a below average pay rate for a production technician? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curren... | among all the production technicians, how many have a below average pay rate for a production technician? |
works_cycles | select cast(sum(case when t2.name = 'united kingdom' then 1 else 0 end) as real) * 100 / count(t1.salesorderid) from salesorderheader as t1 inner join salesterritory as t2 on t1.territoryid = t2.territoryid | Question: what proportion of sales orders are made from the united kingdom? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Business... | what proportion of sales orders are made from the united kingdom? |
works_cycles | select modifieddate from personphone where phonenumber = '1 (11) 500 555-0143' | Question: when is the modified date of the phone number '1500 555-0143'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | when is the modified date of the phone number '1500 555-0143'? |
works_cycles | select businessentityid from salesperson order by salesytd desc limit 1 | Question: what is the business id of the person who has made the most sales total year to date? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate... | what is the business id of the person who has made the most sales total year to date? |
works_cycles | select name from vendor where activeflag = 1 | Question: list all active vendors who offer a purchasing web service. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntity... | list all active vendors who offer a purchasing web service. |
works_cycles | select territoryid from customer where modifieddate < '2014-12-09' group by territoryid order by count(territoryid) desc limit 1 | Question: which territory has the most customers as of 9/12/2014? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, ... | which territory has the most customers as of 9/12/2014? |
works_cycles | select sum(totaldue) from purchaseorderheader where orderdate like '2013-05-29%' | Question: what is the total cost for all the orders placed on 5/29/2013? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | what is the total cost for all the orders placed on 5/29/2013? |
works_cycles | select firstname from person where persontype = 'vc' group by firstname order by count(*) desc limit 1 | Question: what is the most common first name among the vendor contact? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntit... | what is the most common first name among the vendor contact? |
works_cycles | select t2.firstname, t2.middlename, t2.lastname from employee as t1 inner join person as t2 using (businessentityid) where t1.jobtitle = 'production technician - wc50' group by t2.firstname, t2.middlename, t2.lastname | Question: list the full name of all the 'production technician - wc50' | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntit... | list the full name of all the 'production technician - wc50' |
works_cycles | select count(orderqty) from salesorderdetail where productid in ( select productid from product where name = 'minipump' ) | Question: how many minipumps have been sold? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, NameStyle... | how many minipumps have been sold? |
works_cycles | select t2.businessentityid from creditcard as t1 inner join personcreditcard as t2 on t1.creditcardid = t2.creditcardid where t1.cardnumber = 11113366963373 | Question: what is the person's business id with a vista credit card number '11113366963373'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. P... | what is the person's business id with a vista credit card number '11113366963373'? |
works_cycles | select t3.city, t3.addressline1 from businessentityaddress as t1 inner join addresstype as t2 on t1.addresstypeid = t2.addresstypeid inner join address as t3 on t1.addressid = t3.addressid where t1.businessentityid = 5555 and t2.name = 'home' | Question: where does the person with the businessentityid '5555' live? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntit... | where does the person with the businessentityid '5555' live? |
works_cycles | select t2.name from specialofferproduct as t1 inner join product as t2 on t1.productid = t2.productid where t1.specialofferid = 15 | Question: list all the names of products with the special offer '15'. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntity... | list all the names of products with the special offer '15'. |
works_cycles | select t3.creditcardid from person as t1 inner join personcreditcard as t2 on t1.businessentityid = t2.businessentityid inner join creditcard as t3 on t2.creditcardid = t3.creditcardid where t1.firstname = 'michelle' and t1.middlename = 'e' and t1.lastname = 'cox' | Question: what is the credit card number for michelle e cox? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Perso... | what is the credit card number for michelle e cox? |
works_cycles | select t2.name from salesorderheadersalesreason as t1 inner join salesreason as t2 on t1.salesreasonid = t2.salesreasonid where t1.salesorderid = 51883 | Question: what is the reason for sales order '51883'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, ... | what is the reason for sales order '51883'? |
works_cycles | select t2.cardnumber from salesorderheader as t1 inner join creditcard as t2 on t1.creditcardid = t2.creditcardid where t1.salesorderid = 45793 | Question: what is the credit card number for the sales order '45793'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntity... | what is the credit card number for the sales order '45793'? |
works_cycles | select t2.businessentityid from salesterritory as t1 inner join salesperson as t2 on t1.territoryid = t2.territoryid where t1.name = 'northwest' and t1.countryregioncode = 'us' | Question: list all the sales people in the northwest us. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonTyp... | list all the sales people in the northwest us. |
works_cycles | select t1.businessentityid from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.jobtitle like 'production technician%' order by t2.rate desc limit 1 | Question: which production technician has the highest pay rate? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, Pe... | which production technician has the highest pay rate? |
works_cycles | select t2.firstname, t2.middlename, t2.lastname from salesperson as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid where t1.territoryid = 9 | Question: who is the sales person in charge of the territory with the id '9'? provide their full name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modif... | who is the sales person in charge of the territory with the id '9'? provide their full name. |
works_cycles | select t2.description from specialofferproduct as t1 inner join specialoffer as t2 on t1.specialofferid = t2.specialofferid where t1.productid = 762 | Question: what is the description of the discount for the product with the id '762'? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person ->... | what is the description of the discount for the product with the id '762'? |
works_cycles | select avg(t2.rate) from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid group by t1.gender | Question: compare the average pay rate of male and female employees. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityI... | compare the average pay rate of male and female employees. |
works_cycles | select cast(sum(case when t1.name = 'night' then 1 else 0 end) as real) * 100 / count(t2.businessentityid) from shift as t1 inner join employeedepartmenthistory as t2 on t1.shiftid = t2.shiftid | Question: what is the percentage of employees who work the night shift? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnti... | what is the percentage of employees who work the night shift? |
works_cycles | select count(businessentityid) from employee where maritalstatus = 'm' and strftime('%y', birthdate) < '1960' and gender = 'm' | Question: how many married male employees were born before the year 1960? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEn... | how many married male employees were born before the year 1960? |
works_cycles | select name from product order by listprice desc limit 5 | Question: what are the top 5 types of products with the highest selling price? ? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bus... | what are the top 5 types of products with the highest selling price? ? |
works_cycles | select min(hiredate) from employee where jobtitle = 'accountant' | Question: when did the company hired its first accountant? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonT... | when did the company hired its first accountant? |
works_cycles | select jobtitle from employee where strftime('%y', hiredate) = '2007' group by hiredate order by count(jobtitle) desc limit 1 | Question: in 2007, which job position was hired the most? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonTy... | in 2007, which job position was hired the most? |
works_cycles | select lastreceiptcost - standardprice from productvendor order by standardprice desc limit 1 | Question: what is the profit on net of the vendor with the highest standard price? if there are two vendors of the same amount, calculate only for one vendor. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. Country... | what is the profit on net of the vendor with the highest standard price? if there are two vendors of the same amount, calculate only for one vendor. |
works_cycles | select count(t3.name) from person as t1 inner join employeedepartmenthistory as t2 on t1.businessentityid = t2.businessentityid inner join department as t3 on t2.departmentid = t3.departmentid where t1.firstname = 'sheela' and t1.lastname = 'word' and strftime('%y', t3.modifieddate) between '2011' and '2012' | Question: how many departments did sheela ward work in between 1/1/2011 to 12/31/2012 | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -... | how many departments did sheela ward work in between 1/1/2011 to 12/31/2012 |
works_cycles | select avg(2009 - strftime('%y', t2.birthdate)) from person as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid where t1.persontype = 'sp' | Question: what is the average age of the sales agents in the company by 12/31/2009? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> ... | what is the average age of the sales agents in the company by 12/31/2009? |
works_cycles | select t2.groupname from employeedepartmenthistory as t1 inner join department as t2 on t1.departmentid = t2.departmentid group by t2.groupname order by count(t1.businessentityid) limit 1 | Question: to which group does the department with the least amount of workers belong to? indicate the name of the department as well. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> Country... | to which group does the department with the least amount of workers belong to? indicate the name of the department as well. |
works_cycles | select 2015 - strftime('%y', t1.birthdate), t2.rate from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.jobtitle = 'marketing specialist' order by 2015 - strftime('%y', t1.birthdate) desc limit 1 | Question: what is the age of the oldest marketing specialist by 12/31/2015 and what is his/her hourly rate? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ... | what is the age of the oldest marketing specialist by 12/31/2015 and what is his/her hourly rate? |
works_cycles | select t1.unitprice, t3.name from purchaseorderdetail as t1 inner join purchaseorderheader as t2 on t1.purchaseorderid = t2.purchaseorderid inner join vendor as t3 on t2.vendorid = t3.businessentityid order by t1.unitprice limit 1 | Question: what is the total amount due of all the purchases made by the company to the vendor that has the lowest selling price amount of a single product? indicate the name of the vendor to which the purchases was made. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, Modif... | what is the total amount due of all the purchases made by the company to the vendor that has the lowest selling price amount of a single product? indicate the name of the vendor to which the purchases was made. |
works_cycles | select t2.businessentityid, strftime('%y', t2.hiredate) - strftime('%y', t2.birthdate) from purchaseorderheader as t1 inner join employee as t2 on t1.employeeid = t2.businessentityid order by t1.totaldue desc limit 1 | Question: who made the purchase order with the greatest total due before freight? indicate her employee id and calculate for his/her age when he/she was hired. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. Countr... | who made the purchase order with the greatest total due before freight? indicate her employee id and calculate for his/her age when he/she was hired. |
works_cycles | select t2.jobtitle, t1.rate, t3.firstname, t3.middlename, t3.lastname from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid inner join person as t3 on t2.businessentityid = t3.businessentityid order by t1.rate desc limit 9, 1 | Question: what is the position of the employee with the 10th highest salary? indicate his/her salary amount and his/her full name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryReg... | what is the position of the employee with the 10th highest salary? indicate his/her salary amount and his/her full name. |
works_cycles | select t1.listprice - t1.standardcost, t1.name from product as t1 inner join productreview as t2 on t1.productid = t2.productid where t2.reviewername = 'john smith' order by t2.rating desc limit 1 | Question: what is the profit of a single product that received the highest rating from john smith? list the product/s' names. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCo... | what is the profit of a single product that received the highest rating from john smith? list the product/s' names. |
works_cycles | select t1.rate from employeepayhistory as t1 inner join employee as t2 on t1.businessentityid = t2.businessentityid inner join person as t3 on t2.businessentityid = t3.businessentityid order by t2.hiredate asc limit 0, 5 | Question: what is the salary rate per hour that the company paid to the first 5 employees that they hired? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, M... | what is the salary rate per hour that the company paid to the first 5 employees that they hired? |
works_cycles | select t2.name from productvendor as t1 inner join vendor as t2 on t1.businessentityid = t2.businessentityid where t1.maxorderqty between 500 and 750 order by t1.lastreceiptcost - t1.standardprice desc limit 9, 1 | Question: among the vendors with maximum orders betweeen 500 to 750, which vendor has the 10th highest profit on net? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curr... | among the vendors with maximum orders betweeen 500 to 750, which vendor has the 10th highest profit on net? |
works_cycles | select 2011 - strftime('%y', t2.hiredate) from document as t1 inner join employee as t2 on t1.owner = t2.businessentityid where t1.status = 1 | Question: as of 12/31/2011, how long has the employee assigned to all pending for approval papers been working in the company from the date he was hired? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegio... | as of 12/31/2011, how long has the employee assigned to all pending for approval papers been working in the company from the date he was hired? |
works_cycles | select t1.daystomanufacture from product as t1 inner join productreview as t2 on t1.productid = t2.productid where t2.rating = 5 and t1.class = 'm' order by t2.rating limit 1 | Question: jill ranked which medium-quality class product as the highest, and how long will it take the company to manufacture such a product? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency ->... | jill ranked which medium-quality class product as the highest, and how long will it take the company to manufacture such a product? |
works_cycles | select t1.jobtitle, t2.firstname, t2.middlename, t2.lastname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid order by t1.hiredate limit 1 | Question: what was the first job position that the company needed, and who was hired? indicate his/her full name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Currency... | what was the first job position that the company needed, and who was hired? indicate his/her full name. |
works_cycles | select count(t1.transactionid) from transactionhistory as t1 inner join product as t2 on t1.productid = t2.productid where t1.quantity between 100 and 250 and t2.reorderpoint <= 375 | Question: how many work orders with quantities ranging from 100 to 250 have a reorder point of no more than 375? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyC... | how many work orders with quantities ranging from 100 to 250 have a reorder point of no more than 375? |
works_cycles | select avg(t2.rate) from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.gender = 'f' | Question: how much is the average salary of female employees in comparison to male employees? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. ... | how much is the average salary of female employees in comparison to male employees? |
works_cycles | select distinct t4.name from product as t1 inner join productvendor as t2 on t1.productid = t2.productid inner join productsubcategory as t3 on t1.productsubcategoryid = t3.productsubcategoryid inner join vendor as t4 on t2.businessentityid = t4.businessentityid where t1.makeflag = 0 and t1.style = 'w' and t3.name = 't... | Question: what are the names of the vendors to which the company purchased its women's tights products? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modi... | what are the names of the vendors to which the company purchased its women's tights products? |
works_cycles | select t2.payfrequency from employee as t1 inner join employeepayhistory as t2 on t1.businessentityid = t2.businessentityid where t1.jobtitle = 'scheduling assistant' order by t1.hiredate limit 1 | Question: how frequently does the first-ever scheduling assistant get paid? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Business... | how frequently does the first-ever scheduling assistant get paid? |
works_cycles | select t2.class, t2.productline, t2.listprice from shoppingcartitem as t1 inner join product as t2 on t1.productid = t2.productid group by t1.productid order by sum(quantity) limit 1 | Question: what product has the fewest online orders from one customer? list the product's class, line of business, and list price. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryReg... | what product has the fewest online orders from one customer? list the product's class, line of business, and list price. |
works_cycles | select t2.firstname, t2.middlename, t2.lastname from salesperson as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid order by t1.commissionpct desc limit 1 | Question: what is the full name of the sales person who has the the highest commission percent received per sale? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Currency... | what is the full name of the sales person who has the the highest commission percent received per sale? |
works_cycles | select t2.firstname, t2.middlename, t2.lastname from employee as t1 inner join person as t2 on t1.businessentityid = t2.businessentityid order by strftime('%y', t1.hiredate) - strftime('%y', t1.birthdate) desc limit 1, 1 | Question: what is the full name of the second oldest person in the company at the time he was hired? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Modifie... | what is the full name of the second oldest person in the company at the time he was hired? |
works_cycles | select (t2.listprice - t2.standardcost) * sum(t1.quantity), t2.name from shoppingcartitem as t1 inner join product as t2 on t1.productid = t2.productid group by t1.productid, t2.name, t2.listprice, t2.standardcost, t1.quantity order by sum(t1.quantity) desc limit 1 | Question: what is the total profit gained by the company from the product that has the highest amount of quantity ordered from online customers? indicate the name of the product. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, M... | what is the total profit gained by the company from the product that has the highest amount of quantity ordered from online customers? indicate the name of the product. |
works_cycles | select t2.orderqty - t2.receivedqty, vendorid from purchaseorderheader as t1 inner join purchaseorderdetail as t2 on t1.purchaseorderid = t2.purchaseorderid order by t2.orderqty - t2.receivedqty desc limit 1 | Question: what is the highest amount of difference between the ordered quantity and actual quantity received in a single purchase order and to which vendor was the purchase order made? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, N... | what is the highest amount of difference between the ordered quantity and actual quantity received in a single purchase order and to which vendor was the purchase order made? |
works_cycles | select t1.averageleadtime, t1.lastreceiptcost - t1.standardprice, t4.addressline1, t4.addressline2 , t4.city, t4.postalcode from productvendor as t1 inner join vendor as t2 on t1.businessentityid = t2.businessentityid inner join businessentityaddress as t3 on t1.businessentityid = t3.businessentityid inner join address... | Question: what is the average lead time of product id 843? calculate for its profit on net and indicate the full location to which the vendor is located. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegio... | what is the average lead time of product id 843? calculate for its profit on net and indicate the full location to which the vendor is located. |
works_cycles | select count(businessentityid) from salesperson where bonus = 0 | Question: how many salespersons haven't met quota? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, Nam... | how many salespersons haven't met quota? |
works_cycles | select count(salestaxrateid) from salestaxrate where name like '%+%' | Question: among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCod... | among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes? |
works_cycles | select actualcost from transactionhistory where transactiontype = 'p' order by actualcost desc limit 1 | Question: please give the highest product cost of a purchase order. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID... | please give the highest product cost of a purchase order. |
works_cycles | select status from salesorderheader order by freight desc limit 1 | Question: what is the current status of the order with the highest shipping cost? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bu... | what is the current status of the order with the highest shipping cost? |
works_cycles | select count(productid) from productvendor where onorderqty = 0 | Question: how many products are out of stock? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, NameStyl... | how many products are out of stock? |
works_cycles | select lastreceiptcost - standardprice from productvendor order by lastreceiptcost - standardprice desc limit 1 | Question: what is the highest profit on net for a product? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonT... | what is the highest profit on net for a product? |
works_cycles | select reviewername from productreview where rating = ( select rating from productreview order by rating desc limit 1 ) | Question: which reviewer gives the biggest number of the highest rating? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnt... | which reviewer gives the biggest number of the highest rating? |
works_cycles | select t2.name from productreview as t1 inner join product as t2 on t1.productid = t2.productid group by t1.productid order by count(t1.productreviewid) desc limit 1 | Question: which product gets the most reviews? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, PersonType, NameSty... | which product gets the most reviews? |
works_cycles | select count(t1.productid) from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t2.makeflag = 0 and t1.rating != 5 | Question: among the products that are purchased, how many of them have never received the highest rating? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mo... | among the products that are purchased, how many of them have never received the highest rating? |
works_cycles | select t1.comments from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t2.finishedgoodsflag = 1 group by t1.comments order by count(t1.productreviewid) desc limit 1 | Question: what is the biggest amount of reviews a salable product gets? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEnti... | what is the biggest amount of reviews a salable product gets? |
works_cycles | select t2.name from productreview as t1 inner join product as t2 using (productid) where t2.finishedgoodsflag = 1 and t2.makeflag = 1 group by t2.name order by count(t1.comments) > 10 | Question: among the products that are both manufactured in house and salable, how many of them get over 10 reviews? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curren... | among the products that are both manufactured in house and salable, how many of them get over 10 reviews? |
works_cycles | select t2.name from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t2.finishedgoodsflag = 1 group by t2.name order by count(t1.comments) > 10 | Question: please list the names of the products that get over 10 reviews and a salable. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person... | please list the names of the products that get over 10 reviews and a salable. |
works_cycles | select t1.reviewername from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t2.class = 'm' and t2.style = 'w' and t1.rating = 5 | Question: please list the reviewers who have given the highest rating for a medium class, women's product. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, M... | please list the reviewers who have given the highest rating for a medium class, women's product. |
works_cycles | select t2.class from productreview as t1 inner join product as t2 on t1.productid = t2.productid group by t2.class order by count(t1.productreviewid) desc limit 1 | Question: what is the class of the product with the most reviews? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, ... | what is the class of the product with the most reviews? |
works_cycles | select t1.emailaddress from productreview as t1 inner join product as t2 on t1.productid = t2.productid where t2.class = 'h' | Question: please list the e-mails of the reviewers who have reviewed high class. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Bus... | please list the e-mails of the reviewers who have reviewed high class. |
works_cycles | select t2.name from productlistpricehistory as t1 inner join product as t2 on t1.productid = t2.productid group by t2.name order by count(t1.listprice) > 3 | Question: please list the names of the products that have over 3 price changes. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> Busi... | please list the names of the products that have over 3 price changes. |
works_cycles | select t1.description from productdescription as t1 inner join product as t2 where t2.name = 'headset ball bearings' and t1.productdescriptionid = t2.productid | Question: what is the product description of headset ball bearings? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID... | what is the product description of headset ball bearings? |
works_cycles | select t1.standardprice from productvendor as t1 inner join product as t2 on t1.productid = t2.productid where t2.name = 'hex nut 5' order by t1.standardprice desc limit 1 | Question: what is the highest vendor's selling price for hex nut 5? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID... | what is the highest vendor's selling price for hex nut 5? |
works_cycles | select t1.standardprice from productvendor as t1 inner join product as t2 on t1.productid = t2.productid where t2.name = 'hex nut 5' group by t1.standardprice order by count(t1.standardprice) desc limit 1 | Question: please list all the vendors' usual selling prices of the product hex nut 5. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -... | please list all the vendors' usual selling prices of the product hex nut 5. |
works_cycles | select count(distinct t3.name) from productvendor as t1 inner join product as t2 on t1.productid = t2.productid inner join vendor as t3 on t1.businessentityid = t3.businessentityid where t2.name = 'hex nut 5' and t3.creditrating = 1 and 3 | Question: among the vendors that sell the product hex nut 5, how many of them have a good credit rating? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mod... | among the vendors that sell the product hex nut 5, how many of them have a good credit rating? |
works_cycles | select t3.purchasingwebserviceurl from productvendor as t1 inner join product as t2 on t1.productid = t2.productid inner join vendor as t3 on t1.businessentityid = t3.businessentityid where t2.name = 'hex nut 5' | Question: please list the website purchasing links of the vendors from whom the product hex nut 5 can be purchased. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, Curren... | please list the website purchasing links of the vendors from whom the product hex nut 5 can be purchased. |
works_cycles | select t3.name from productvendor as t1 inner join product as t2 on t1.productid = t2.productid inner join vendor as t3 on t1.businessentityid = t3.businessentityid where t2.name = 'hex nut 5' order by t1.standardprice limit 1 | Question: which vendor's selling price for hex nut 5 is the lowest, please give the vendor's name. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedD... | which vendor's selling price for hex nut 5 is the lowest, please give the vendor's name. |
works_cycles | select count(t2.name) from productvendor as t1 inner join product as t2 using (productid) inner join vendor as t3 on t1.businessentityid = t3.businessentityid where t3.preferredvendorstatus = 1 and t2.class = 'm' | Question: how many high-class products are sold by preferred vendors? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntity... | how many high-class products are sold by preferred vendors? |
works_cycles | select t2.listprice from product as t1 inner join productlistpricehistory as t2 on t1.productid = t2.productid where t1.name = 'll fork' | Question: please give all the list prices of the product ll fork. | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, ModifiedDate. Person -> BusinessEntityID, ... | please give all the list prices of the product ll fork. |
works_cycles | select sum(case when t1.productline = 'm' then 1 else 0 end) from product as t1 inner join productvendor as t2 on t1.productid = t2.productid inner join vendor as t3 on t2.businessentityid = t3.businessentityid group by t1.productid having count(t1.name) > 2 | Question: among the products from the mountain product line, how many of them are sold by over 2 vendors? | Tables: CountryRegion -> CountryRegionCode, Name, ModifiedDate. Culture -> CultureID, Name, ModifiedDate. Currency -> CurrencyCode, Name, ModifiedDate. CountryRegionCurrency -> CountryRegionCode, CurrencyCode, Mo... | among the products from the mountain product line, how many of them are sold by over 2 vendors? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.