context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many products with the highest unit price were ordered? | SELECT OrderQty FROM PurchaseOrderDetail ORDER BY UnitPrice DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Between Northwest and Southeast of the United States, which territory one recorded the highest amount of sales last year? | SELECT Name FROM SalesTerritory WHERE CountryRegionCode = 'US' AND (Name = 'Northwest' OR Name = 'Southeast') ORDER BY SalesLastYear DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the full name of the Document Control Manager who is in charge of all Level 1 approved documents? | 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... | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Which customer has the highest subtotal amount of sales orders whose assigned to the salesperson with the highest bonus? | SELECT T1.CustomerID FROM SalesOrderHeader AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID ORDER BY T1.SubTotal DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the total price of Sales Order ID 46625 with Volume Discount 11 to 14 and Product ID 716? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the highest amount of bonus earned by the sales person in Canada? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What are the names of the product that has the lowest rating? | 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 ) | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many of the workers who started working in 2009 are from the Production Department? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Who is the company's highest-paid single female employee? Include her full name and job title. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Who is the Vice President of Engineering and when did he join the company? Indicate his/her full name. | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many active employees whose payrate is equal or below 30 per hour. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Which department has a worker who just recently started working? | SELECT T1.Name FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID ORDER BY T2.StartDate DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Which store sales person was reently hired? Indicate his/her full name and gender. | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How frequently do the employee with the least number of sick leave hours get paid? | SELECT T2.PayFrequency FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.SickLeaveHours ASC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Which job title has the lowest pay? | SELECT T1.JobTitle FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.Rate ASC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the total number of employees that worked in the Finance department? | SELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 USING (DepartmentID) WHERE T1.Name = 'Finance' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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. | 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 ) | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many accounts have an address that is too long? | SELECT COUNT(*) FROM Address WHERE AddressLine2 <> '' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the postal code of the street address of the account that is latest updated? | SELECT PostalCode FROM Address ORDER BY ModifiedDate DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the longest assembly item duration for bicycles? | SELECT JULIANDAY(EndDate) - JULIANDAY(StartDate) FROM BillOfMaterials ORDER BY JULIANDAY(EndDate) - JULIANDAY(StartDate) DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many assembly items for bicycles aren't finished? | SELECT COUNT(BillOfMaterialsID) FROM BillOfMaterials WHERE EndDate IS NULL | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the unit measure code of the component that is of the greatest need in quantity to create the assembly. | SELECT UnitMeasureCode FROM BillOfMaterials ORDER BY PerAssemblyQty DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many product maintenance documents are private? | SELECT COUNT(DocumentNode) FROM Document WHERE DocumentSummary IS NULL | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the titles of the documents that are pending approval. | SELECT Title FROM Document WHERE Status = 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the job titles of the employees who has a document that has been approved. | SELECT DISTINCT T2.BusinessEntityID, T2.JobTitle FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T1.Status = 2 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the pay frequency of the oldest employee? | SELECT T1.PayFrequency FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.BirthDate ASC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the employees whose pay frequencies are the highest, how many of them are married? | 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 ) | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | For the employee who has been hired the latest, what is his or her pay rate? | SELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.HireDate DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the employees who have a pay rate of above 40, how many of them are male? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the highest pay rate of the employees who are exempt from collective bargaining? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | For the employees who have the highest pay frequency, please list their vacation hours. | 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 ) | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the pay rate of the employee who has the longest vacation hours? | SELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.VacationHours DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many employees with a pay rate of over 35 have more than 10 sick leave hours? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the active male employees, how many of them are paid with the highest frequency? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many male employees have the job position of sales person? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the job position of the oldest employee? | SELECT T2.PersonType FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.BirthDate ASC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the name style of the employee with the lowest pay rate? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the employees who are married, how many of them have a western name style? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the employees who have more than 10 hours of sick leave, how many of them wish to receive e-mail promotions? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the employees who have more than 20 vacations hours and wish to receive e-mail promotions. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please give the additional contact information of the oldest employee with the jod position of sales person. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the first name of the male employee who has a western name style? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the active employees, how many of them have a courtesy title of "Mr"? | 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.' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please give the personal information of the married employee who has the highest pay rate. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the surname suffix of the employee who works as a store contact and has the longest sick leave hours? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the married employees with the highest pay frequency, how many of them have an eastern name style? | 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 ... | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many active employees do not wish to receive e-mail promotions? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the credit card IDs of the employees who work as store contact. | SELECT T2.CreditCardID FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SC' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many vacation hours do the male employees have on average? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | If a married employee has a western name style, what is the probability of him or her working as a store contact? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Among the active employees with over 10 hours of sick leave, what is the percentage of the employees with over 20 vacation hours? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Average of the last receipt cost of the products whose average lead time is 60 days. | SELECT SUM(LastReceiptCost) / COUNT(ProductID) FROM ProductVendor WHERE AverageLeadTime = 60 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Average cost of purchase orders made during the first six months of 2012. | SELECT CAST(SUM(ActualCost) AS REAL) / COUNT(TransactionID) FROM TransactionHistoryArchive WHERE TransactionType = 'P' AND TransactionDate >= '2012-01-01' AND TransactionDate < '2012-07-01' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What percentage of male employees hired throughout the years 2009 are married? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What percentage of people named Mary who wants Receive Email promotions of AdventureWorks and selected partners are store contacts? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | List, by ProductID, all products whose profit, relative to the standard price, is negative. | SELECT DISTINCT ProductID FROM ProductVendor WHERE StandardPrice - LastReceiptCost < 0 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the average total due price of products with approved status? | SELECT SUM(TotalDue) / COUNT(TotalDue) FROM PurchaseOrderHeader WHERE Status = 2 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the percentage, by number of sales order units, for orders with quantities not greater than 3 and a discount of 0.2? | SELECT CAST(SUM(CASE WHEN OrderQty < 3 AND UnitPriceDiscount = 0.2 THEN 1 ELSE 0 END) AS REAL) / COUNT(SalesOrderID) FROM SalesOrderDetail | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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. | SELECT BusinessEntityID FROM SalesPerson WHERE SalesYTD > SalesLastYear + SalesLastyear * 0.6 AND Bonus > 3000 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Add the number of businesses that indicate their home address as their address and those whose address corresponds to the shipping address. | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Identifies the ID number of the customer whose sales order for 32 units had a unit price of 35. | SELECT T2.CustomerID FROM SalesOrderDetail AS T1 INNER JOIN Customer AS T2 WHERE T1.UnitPrice = 35 AND T1.OrderQty = 32 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What company has a Colonial Voice card that expired in March 2005? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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? | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Calculate the number of products if we add the products of the accessories and components categories. | SELECT COUNT(ProductID) FROM Product WHERE Name LIKE '%accessories %' OR Name LIKE '%components%' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the job title of the newest employee in department 12? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | List the first and last name of all unmarried male Production Supervisors. | 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%' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many products are there if we add all those located in the Subassembly category? | SELECT COUNT(T1.LocationID) FROM Location AS T1 INNER JOIN ProductInventory AS T2 USING (LocationID) WHERE T1.Name = 'Subassembly' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Sum the total number of products rejected for having a trim length that is too long. | 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' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status. | SELECT SUM(T2.OrderQty) FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID WHERE T1.Status = 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | 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? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the name of the subcategory to which the gray product with the lowest safety stock level belongs? | SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the product cost end date with the highest weight in grams? | SELECT T2.EndDate FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WeightUnitMeasureCode = 'G' ORDER BY T1.Weight DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the percentage of the total products ordered were not rejected by Drill size? | 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 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Calculate the average of the total ordered quantity of products purchased whose shipping method was Cargo Transport 5. | SELECT CAST(SUM(IIF(T1.ShipMethodID = 5, T3.OrderQty, 0)) AS REAL) / COUNT(T3.ProductID) FROM ShipMethod AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.ShipMethodID = T2.ShipMethodID INNER JOIN PurchaseOrderDetail AS T3 ON T2.PurchaseOrderID = T3.PurchaseOrderID | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | List the name of the rates that apply to the provinces that are in the territory that obtained the greatest increase in sales with respect to the previous year. | SELECT T2.Name FROM SalesTerritory AS T1 INNER JOIN StateProvince AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode INNER JOIN SalesTaxRate AS T3 ON T2.StateProvinceID = T3.StateProvinceID ORDER BY (T1.SalesYTD - T1.SalesLastYear) / T1.SalesLastYear DESC LIMIT 1 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many employees earn their salaries on a monthly basis at an hourly rate of more than 50? | SELECT COUNT(BusinessEntityID) FROM EmployeePayHistory WHERE rate * PayFrequency > 50 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the employee of company number 1's full name? | SELECT FirstName, MiddleName, LastName FROM Person WHERE BusinessEntityID = 1 AND PersonType = 'EM' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the name of the supplier number 1492? | SELECT NAME FROM Vendor WHERE BusinessEntityID = 1492 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many vendors only consented to move on with the 500 to 15000 piece order in terms of quality? | SELECT COUNT(*) FROM ProductVendor WHERE MinOrderQty > 500 AND MaxOrderQty < 15000 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the departments that are part of the Executive General and Administration group. | SELECT Name FROM Department WHERE GroupName = 'Executive General and Administration' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the family names of any employees whose middle names begin with C. | SELECT LastName FROM Person WHERE PersonType = 'EM' AND MiddleName LIKE 'C%' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many vendors are having their products ordered with an average delivery time of 25 days? | SELECT COUNT(DISTINCT BusinessEntityID) FROM ProductVendor WHERE AverageLeadTime = 25 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list any 3 product numbers with the lowest standard cost. | SELECT ProductID FROM ProductCostHistory ORDER BY StandardCost ASC LIMIT 3 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many black-colored products are there that cannot be sold? | SELECT COUNT(ProductID) FROM Product WHERE FinishedGoodsFlag = 0 AND Color = 'Black' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list the top three employees with the most unused sick leave along with their position titles. | SELECT JobTitle FROM Employee ORDER BY SickLeaveHours DESC LIMIT 3 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the full address of address number 11906? | SELECT AddressLine1, AddressLine2 FROM Address WHERE AddressID = 11906 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is business number 1580's net profit? | SELECT LastReceiptCost - StandardPrice FROM ProductVendor WHERE BusinessEntityID = 1580 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the sales revenue for item number 740? | SELECT ListPrice - StandardCost FROM Product WHERE ProductID = 740 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many customers gave a product the best possible rating? Please list their names. | SELECT ReviewerName FROM ProductReview WHERE Rating = 5 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What are the company that Adventure Works deal with that have poor credit rating? Please provide their business number. | SELECT BusinessEntityID FROM Vendor WHERE CreditRating = ( SELECT CreditRating FROM Vendor ORDER BY CreditRating DESC LIMIT 1 ) | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the forename and birthdate of person number 18? | SELECT T1.FirstName, T2.BirthDate FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.BusinessEntityID = 18 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What job is person number 322 currently holding? | SELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID WHERE T2.BusinessEntityID = 332 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | Please list 3 businesses along with their IDs that use cellphones. | SELECT T2.BusinessEntityID FROM PhoneNumberType AS T1 INNER JOIN PersonPhone AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID WHERE T1.Name = 'Cell' LIMIT 3 | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | What is the currency of Brazil? | SELECT T1.Name FROM Currency AS T1 INNER JOIN CountryRegionCurrency AS T2 ON T1.CurrencyCode = T2.CurrencyCode INNER JOIN CountryRegion AS T3 ON T2.CountryRegionCode = T3.CountryRegionCode WHERE T3.Name = 'Brazil' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How many people work in the finance department? | SELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T1.Name = 'Finance' | bird |
CREATE TABLE works_cycles (CountryRegionCode text, Name text, ModifiedDate datetime, CultureID text, Name text, ModifiedDate datetime, CurrencyCode text, Name text, ModifiedDate datetime, CountryRegionCode text, CurrencyCode text, ModifiedDate datetime, BusinessEntityID integer, PersonType text, NameStyle integer, Titl... | How long does it take for the business to receive the item it has purchased? Who is the vendor for business number 1496? | SELECT T1.AverageLeadTime, T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 USING (businessentityid) WHERE T2.BusinessEntityID = 1496 GROUP BY T1.AverageLeadTime, T2.Name | bird |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.