db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
1
673
SQL
stringlengths
23
804
schema
stringclasses
69 values
works_cycles
List down the email address of female single employees.
female refers to Gender = 'F'; single refers to MaritalStatus = 'S';
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What are the color of products that were reviewed?
null
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the projected sales quota amount in 2013 and sales YTD amount for sales person with business entity ID 275?
projected sales quota refers to SalesQuota; projected sales quota in 2013 refers to year(QuotaDate) = 2013; projected sales quota for 2013 = SUM(SalesQuota where year(QuotaDate) = 2013);
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Provide the business entity ID who did not achieved projected yearly sales quota in 2013.
projected yearly sales quota refers to SalesQuota; sales quota in 2013 refers to year(QuotaDate) = 2013; person who did not achieve projected yearly sales quota refers to SalesQuota>SalesYTD;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the employees who wish to receive e-mail promotion from AdventureWorks, how many percent of them are female?
female refers to Gender = 'F'; employee who wish to receive email promotion refers to EmailPromotion = 1; percentage = DIVIDE(SUM(Gender = 'F')), (sum(Gender = 'F' or Gender = 'M'))) as percentage;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many times is married non sales employees against single non-sales employees?
non-sales employee refers to PersonType = 'EM'; married refers to MaritalStatus = 'M'; single refers to MaritalStatus = 'S'; percentage = DIVIDE(SUM(MaritalStatus = 'M'), (SUM(MaritalStatus = 'S') as percentage;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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?
projected yearly sales quota refers to SalesQuota; projected yearly sales quota in 2013 refers to year(QuotaDate) = 2013; percentage = (MULTIPLY(DIVIDE(SUM(Bonus)), (SUM(SalesQuota))) as percentage;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many types of credit cards are there and how many are vista?
type of credit card refers to CardType; CardType = 'Vista';
SELECT COUNT(CardNumber) FROM CreditCard WHERE CardType = 'vista'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the name of the product with the id "475"?
null
SELECT Name FROM Product WHERE ProductID = 475
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the employees born before 1980 , how many of them are single?
BirthDate<'1980-01-01'; single refers to MaritalStatus = 'S' or null;
SELECT COUNT(BusinessEntityID) FROM Employee WHERE MaritalStatus = 's' AND BirthDate < '1980-1-1'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all the names of the stores assigned to the sales person with the id "277".
null
SELECT Name FROM Store WHERE SalesPersonID = 277
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many products with the id "989" were sold in August 2013?
TransactionDate BETWEEN '2013-08-01' AND '2013-08-30'; sold in refers to TransactionType = 'S' which means SalesOrder;
SELECT SUM(Quantity) FROM TransactionHistory WHERE TransactionDate LIKE '2013-08%' AND TransactionType = 'S' AND ProductID = 989
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all of the credit cards that had expired by 2007.
card that expires in 2007 refers to ExpYear = 2007;
SELECT CardNumber FROM CreditCard WHERE ExpYear < 2007
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all the pay rates of all employees that were hired at 20 years of age.
pay rate refers to Rate; 20 years old at the time of being hired refers to SUBTRACT(year(HireDate)), (year(BirthDate))) = 20;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the name of the territory assigned to the sales person with business id "277"?
business id refers to BusinessEntityID
SELECT T2.Name FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.BusinessEntityID = 277
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the full name of the Vice President of Production?
full name = FirstName+MiddleName+LastName; Vice President of Production is a JobTitle;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many employees in the Information Service department work the evening shift?
Information Service is a name of department;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all the purchase order ids of the vendor with a below average rating.
below average rating refers to CreditRating = 5;
SELECT T2.PurchaseOrderID FROM Vendor AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.BusinessEntityID = T2.VendorID WHERE T1.CreditRating = 5
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Is the phone number "114-555-0100" a work number or a home number?
null
SELECT T2.Name FROM PersonPhone AS T1 INNER JOIN PhoneNumberType AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID WHERE T1.PhoneNumber = '114-555-0100'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the total shipment by "cargo transport 5" cost of all purchase orders created on 12/14/2011?
Catgo Transport 5 is a name of shipping method; OrderDate = '2011-12-14'; total shipment cost = SUM(Freight);
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many sales orders did the salesperson David R. Campbell create?
SP is an abbreviation for Sales Person; PersonType = 'SP';
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the email address of the Facilities Manager?
Facilities Manager is a job title
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many customers are there in Canada?
Canada is name of sales territory
SELECT COUNT(T2.CustomerID) FROM SalesTerritory AS T1 INNER JOIN Customer AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.Name = 'Canada'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the shipping address for the sales order "43873"?
shipping address = AddressLine1+AddressLine2+City;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List the first names of the people with more than 65 sick leave hours.
SickLeaveHours>65;
SELECT T2.FirstName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.SickLeaveHours > 65
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among all the production technicians, how many have a below average pay rate for a production technician?
production technician is a job title; below average rate refers to Rate<AVG(Rate);
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 WHERE T1.JobTitle LIKE 'Production Technician%' )
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What proportion of sales orders are made from the United Kingdom?
proportion = DIVIDE(SUM(Name = 'UK')), (COUNT(SalesOrderID))) as count;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
When is the modified date of the phone number "1500 555-0143"?
null
SELECT ModifiedDate FROM PersonPhone WHERE PhoneNumber = '1 (11) 500 555-0143'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the business ID of the person who has made the most sales total year to date?
business ID refers to BusinessEntityID; sales total year to date refers to SalesYTD; most sales total year to date refers to MAX(SalesYTD);
SELECT BusinessEntityID FROM SalesPerson ORDER BY SalesYTD DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all active vendors who offer a purchasing web service.
active vendors refers to ActiveFlag = 1; vendor who offer a purchasing web service refers to PurchasingWebServiceURL NOT null;
SELECT Name FROM Vendor WHERE ActiveFlag = 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Which territory has the most customers as of 9/12/2014?
ModifiedDate between'2014-09-12 00:00:00' and '2014-09-12 23:59:59';
SELECT TerritoryID FROM Customer WHERE ModifiedDate < '2014-12-09' GROUP BY TerritoryID ORDER BY COUNT(TerritoryID) DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the total cost for all the orders placed on 5/29/2013?
total cost = SUM(TotalDue); OrderDate = '2013-05-29';
SELECT SUM(TotalDue) FROM PurchaseOrderHeader WHERE OrderDate LIKE '2013-05-29%'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the most common first name among the vendor contact?
vendor contact refers to PersonType = 'VC';
SELECT FirstName FROM Person WHERE PersonType = 'VC' GROUP BY FirstName ORDER BY COUNT(*) DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List the full name of all the 'Production Technician - WC50'
full name = FirstName+MiddleName+LastName; Production Technician - WC50 is a job title;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many Minipumps have been sold?
Minipump is name of a product
SELECT COUNT(OrderQty) FROM SalesOrderDetail WHERE ProductID IN ( SELECT ProductID FROM Product WHERE Name = 'Minipump' )
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the person's business ID with a vista credit card number "11113366963373"?
business id refers to BusinessEntityID
SELECT T2.BusinessEntityID FROM CreditCard AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.CardNumber = 11113366963373
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Where does the person with the BusinessEntityID "5555" live?
where the person live refers addresstype.Name = 'Home'
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all the names of products with the special offer "15".
null
SELECT T2.Name FROM SpecialOfferProduct AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.SpecialOfferID = 15
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the credit card number for Michelle E Cox?
credit card number refers to CreditCardID
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the reason for sales order "51883"?
reason means the category of sales reason which refers to ReasonType
SELECT T2.Name FROM SalesOrderHeaderSalesReason AS T1 INNER JOIN SalesReason AS T2 ON T1.SalesReasonID = T2.SalesReasonID WHERE T1.SalesOrderID = 51883
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the credit card number for the sales order "45793"?
null
SELECT T2.CardNumber FROM SalesOrderHeader AS T1 INNER JOIN CreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.SalesOrderID = 45793
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
List all the sales people in the Northwest US.
Northwest is name of SalesTerritory; US is the CountryRegionCode;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Which Production Technician has the highest pay rate?
highest pay rate refers to MAX(Rate);
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Who is the sales person in charge of the territory with the id "9"? Provide their full name.
full name = FirstName+MiddleName+LastName;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the description of the discount for the product with the id "762"?
null
SELECT T2.Description FROM SpecialOfferProduct AS T1 INNER JOIN SpecialOffer AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID WHERE T1.ProductID = 762
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Compare the average pay rate of male and female employees.
male refers to Gender = 'M'; female refers to Gender = 'F'; difference in average rate = DIVIDE(AVG(Rate where Gender = 'F')), (AVG(Rate where Gender = 'M'))) as diff;
SELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID GROUP BY T1.Gender
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the percentage of employees who work the night shift?
percentage = DIVIDE(SUM(Name = 'Night')), (COUNT(ShiftID)) as percentage;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many married male employees were born before the year 1960?
married refers to MaritalStatus = 'M'; male refers to Gender = 'M'; BirthDate < = '1959-12-31';
SELECT COUNT(BusinessEntityID) FROM Employee WHERE MaritalStatus = 'M' AND STRFTIME('%Y', BirthDate) < '1960' AND Gender = 'M'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What are the top 5 types of products with the highest selling price? ?
highest selling price refers to MAX(ListPrice);
SELECT Name FROM Product ORDER BY ListPrice DESC LIMIT 5
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
When did the company hired its first Accountant?
Accountant is a job title; first hired = MIN(HireDate)
SELECT MIN(HireDate) FROM Employee WHERE JobTitle = 'Accountant'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
In 2007, which job position was hired the most?
Job position and job title are synonyms; job position that was hired the most refers to MAX(COUNT(JobTitle); HireDate BETWEEN '2007-1-1' AND '2007-12-31';
SELECT JobTitle FROM Employee WHERE STRFTIME('%Y', HireDate) = '2007' GROUP BY HireDate ORDER BY COUNT(JobTitle) DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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.
profit on net = SUBTRACT(LastReceiptCost, StandardPrice);
SELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY StandardPrice DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many departments did Sheela Ward work in between 1/1/2011 to 12/31/2012
number of departments an employee works for between 2011 and 2012 refers to year(StartDate) BETWEEN 2011 AND 2012 and year(EndDate) BETWEEN 2011 and 2012;
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the average age of the sales agents in the company by 12/31/2009?
average age as of 12/31/2009 = AVG(SUBTRACT(2009, year(BirthDate));
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
To which group does the department with the least amount of workers belong to? Indicate the name of the department as well.
least amount of workers refers to MIN(count(DepartmentID));
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the age of the oldest Marketing Specialist by 12/31/2015 and what is his/her hourly rate?
age as of 12/31/2015 = SUBTRACT(2015, year(BirthDate)); hourly rate refers to Rate;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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.
Vendor's selling price of a single product refers to UnitPrice;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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.
total due before freight = SUBTRACT(TotalDue, Freight); age at the time an employee was hired = SUBTRACT(HireDate, year(BirthDate);
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the position of the employee with the 10th highest salary? Indicate his/her salary amount and his/her full name.
salary and Rate are synonyms; full name = FirstName+MiddleName+LastName;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the profit of a single product that received the highest rating from John Smith? List the product/s' names.
highest rating refers to Rating = 5; profit = SUBTRACT(ListPrice, StandardCost);
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the salary rate per hour that the company paid to the first 5 employees that they hired?
salary rate per hour refers to Rate; first 5 employees that were hired refers to 5 oldest HireDate;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the vendors with maximum orders betweeen 500 to 750, which vendor has the 10th highest profit on net?
maximum orders refers to MaxOrderQty; MaxOrderQty BETWEEN '500' AND '750'; profit on net = SUBTRACT(LastReceiptCost, StandardPrice);
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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?
pending for approval papers refer to Status = 1; length of stay in the company as of 12/31/2011 = SUBTRACT(2011, year(HireDate));
SELECT 2011 - STRFTIME('%Y', T2.HireDate) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T1.Status = 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Jill ranked which medium-quality class product as the highest, and how long will it take the company to manufacture such a product?
second-lowest rating refers to Rating = 2; high-quality class product refers to Class = 'H'; length of time it takes the company to manufacture a product refers to DaysToManufacture;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What was the first job position that the company needed, and who was hired? Indicate his/her full name.
job position and job title are synonyms; full name = FirstName+MiddleName+LastName;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many work orders with quantities ranging from 100 to 250 have a reorder point of no more than 375?
work order refers to TransactionType = 'W'; Quantity BETWEEN 100 AND 250; ReorderPoint< = 375;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How much is the average salary of female employees in comparison to male employees?
female refers to Gender = 'F'; male refers to Gender = 'M'; difference in the average salary of female against male employees = SUBTRACT(AVG(Rate where Gender = 'F')), (AVG(Rate where Gender = 'M')));
SELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'F'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What are the names of the vendors to which the company purchased its women's tights products?
product is purchased refers to MakeFlag = 0; women's refers to Style = 'W'; ProductSubcategoryID = 'Tights';
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 = 'Tights'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How frequently does the first-ever Scheduling Assistant get paid?
PayFrequency = 1 refers to ‘Salary received monthly’; PayFrequency = 2 refers to ‘Salary received biweekly';
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What product has the fewest online orders from one customer? List the product's class, line of business, and list price.
fewest online orders refer to MIN(Quantity);
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the full name of the sales person who has the the highest commission percent received per sale?
commision percent received per sale refers to CommissionPct; highest commision percent received per sale refers to MAX(CommissionPcT); full name = FirstName+MiddleName+LastName;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the full name of the second oldest person in the company at the time he was hired?
age at the time of being hired = SUBTRACT(HireDate, BirthDate); full name = FirstName+MiddleName+LastName;
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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.
profit = MULTIPLY(SUBTRACT(ListPrice, Standardcost)), (Quantity)));
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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?
highest amount of difference between the ordered quantity and actual quantity received in a single purchase order refers to MAX(SUBTRACT(OrderQty, ReceivedQty));
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
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.
Profit on net = SUBTRACT(LastReceiptCost, StandardPrice); full location = AddressLine1+AddressLine2+City+PostalCode;
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 AS T4 ON T3.AddressID = T4.AddressID WHERE T1.ProductID = 843
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many salespersons haven't met quota?
salesperson that haven't met the quota refers to Bonus = 0;
SELECT COUNT(BusinessEntityID) FROM SalesPerson WHERE Bonus = 0
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes?
tax applied to retail transaction refers to Taxtype = 1; sales that are charged with multiple types of tax refers to NAME LIKE '%+%';
SELECT COUNT(SalesTaxRateID) FROM SalesTaxRate WHERE Name LIKE '%+%'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please give the highest product cost of a purchase order.
product cost refers to ActualCost; purchase order refers to TransactionType = 'P';
SELECT ActualCost FROM TransactionHistory WHERE TransactionType = 'P' ORDER BY ActualCost DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the current status of the order with the highest shipping cost?
shipping cost and Freight are synonyms; highest shipping cost refers to MAX(Freight);
SELECT Status FROM SalesOrderHeader ORDER BY Freight DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many products are out of stock?
out of stock product refers to OnOrderQty = 0;
SELECT COUNT(ProductID) FROM ProductVendor WHERE OnOrderQty = 0
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the highest profit on net for a product?
profit on net = subtract(LastReceiptCost, StandardPrice)
SELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY LastReceiptCost - StandardPrice DESC LIMIT 1
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Which reviewer gives the biggest number of the highest rating?
highest rating refers to MAX(Rating)
SELECT ReviewerName FROM ProductReview WHERE Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating DESC LIMIT 1 )
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Which product gets the most reviews?
most reviews refers to MAX(count(ProductID))
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the products that are purchased, how many of them have never received the highest rating?
product that are purchased refers to MakeFlag = 0; never received highest rating refers to Rating! = 5
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the biggest amount of reviews a salable product gets?
salable product refers to FinishedGoodsFlag = 1; biggest amount reviews refers to MAX(count(ProductID))
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the products that are both manufactured in house and salable, how many of them get over 10 reviews?
manufactured in house refers to MakeFlag = 1; salable product refers to FinishedGoodsFlag = 1; over 10 reviews refers to count(comments)>10
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list the names of the products that get over 10 reviews and a salable.
salable product refers to FinishedGoodsFlag = 1; over 10 reviews refers to count(comments)>10
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list the reviewers who have given the highest rating for a medium class, women's product.
highest rating refers to Rating = 5; high class refers to Class = 'H'; men's product refers to Style = 'M'
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the class of the product with the most reviews?
most review refers to MAX(count(comments)); high class refers to Class = 'H'; medium class refers to Class = 'M'; low class refers to Class = 'L'
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list the e-mails of the reviewers who have reviewed high class.
high class refers to Class = 'H'; men's product refers to Style = 'M'
SELECT T1.EmailAddress FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Class = 'H'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list the names of the products that have over 3 price changes.
over 3 price changes refers to count(ListPrice)>3
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the product description of Headset Ball Bearings?
Headset Ball Bearings is name of a product
SELECT T1.Description FROM ProductDescription AS T1 INNER JOIN Product AS T2 WHERE T2.Name = 'Headset Ball Bearings' AND T1.productDescriptionID = T2.ProductID
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
What is the highest vendor's selling price for Hex Nut 5?
vendor's selling price refers to StandardPrice
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list all the vendors' usual selling prices of the product Hex Nut 5.
vendor's selling price refers to StandardPrice
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the vendors that sell the product Hex Nut 5, how many of them have a good credit rating?
good credit rating refers to CreditRating between 1 and 3
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please list the website purchasing links of the vendors from whom the product Hex Nut 5 can be purchased.
website purchasing link refers to PurchasingWebServiceURL
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Which vendor's selling price for Hex Nut 5 is the lowest, please give the vendor's name.
vendor's selling price refers to StandardPrice; lowest selling price = MIN(StandardPrice)
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
How many high-class products are sold by preferred vendors?
preferred vendor refers to PreferredVendorStatus = 1; high class refers to Class = 'H'
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'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Please give all the list prices of the product LL Fork.
Hex Nut 5 is name of a product
SELECT T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'LL Fork'
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,
works_cycles
Among the products from the mountain product line, how many of them are sold by over 2 vendors?
mountain product line refers to ProductLine = 'M'; sold by over 5 vendors refers to count(Name)>5
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
database name:db_id works_cycles CountryRegion table CountryRegion Cols: Country Region Code dtype text, Name dtype text, modified date dtype datetime, Culture table Culture Cols: Culture ID dtype text, Name dtype text, modified date dtype datetime, Currency table Currency Cols: Currency Code dtype text, Name dtype text, modified date dtype datetime, CountryRegionCurrency table CountryRegionCurrency Cols: Country Region Code dtype text, Currency Code dtype text, modified date dtype datetime, Person table Person Cols: Business Entity ID dtype integer, Person Type dtype text, Name Style dtype integer, Title dtype text, First Name dtype text, Middle Name dtype text, Last Name dtype text, Suffix dtype text, Email Promotion dtype integer, Additional Contact Info dtype text, Demographics dtype text, rowguid dtype text, modified date dtype datetime, BusinessEntityContact table BusinessEntityContact Cols: Business Entity ID dtype integer, Person ID dtype integer, Contact Type ID dtype integer, rowguid dtype text, modified date dtype datetime, EmailAddress table EmailAddress Cols: Business Entity ID dtype integer, Email Address ID dtype integer, Email Address dtype text, rowguid dtype text, modified date dtype datetime, Employee table Employee Cols: Business Entity ID dtype integer, National ID Number dtype text, Login ID dtype text, Organization Node dtype text, Organization Level dtype integer, Job Title dtype text, Birth Date dtype date, Marital Status dtype text, Gender dtype text, Hire Date dtype date, Salaried Flag dtype integer, Vacation Hours dtype integer, Sick Leave Hours dtype integer, Current Flag dtype integer, rowguid dtype text, modified date dtype datetime, Password table Password Cols: Business Entity ID dtype integer, Password Hash dtype text, Password Salt dtype text, rowguid dtype text, modified date dtype datetime, PersonCreditCard table PersonCreditCard Cols: Business Entity ID dtype integer, Credit Card ID dtype integer, modified date dtype datetime, ProductCategory table ProductCategory Cols: Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, ProductDescription table ProductDescription Cols: Product Description ID dtype integer, Description dtype text, rowguid dtype text, modified date dtype datetime, ProductModel table ProductModel Cols: Product Model ID dtype integer, Name dtype text, Catalog Description dtype text, Instructions dtype text, rowguid dtype text, modified date dtype datetime, ProductModelProductDescriptionCulture table ProductModelProductDescriptionCulture Cols: Product Model ID dtype integer, Product Description ID dtype integer, Culture ID dtype text, modified date dtype datetime, ProductPhoto table ProductPhoto Cols: Product Photo ID dtype integer, Thumb Nail Photo dtype blob, Thumbnail Photo File Name dtype text, large photo dtype blob, Large Photo File Name dtype text, Modified Date dtype datetime, ProductSubcategory table ProductSubcategory Cols: Product Subcategory ID dtype integer, Product Category ID dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, SalesReason table SalesReason Cols: SalesReasonID dtype integer, Name dtype text, ReasonType dtype text, modified date dtype datetime, SalesTerritory table SalesTerritory Cols: TerritoryID dtype integer, Name dtype text, Country Region Code dtype text, Group dtype text, Sales Year to Date dtype real, Sales Last Year dtype real, Cost Year to Date dtype real, Cost Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPerson table SalesPerson Cols: Business Entity ID dtype integer, Territory ID dtype integer, Sales Quota dtype real, Bonus dtype real, Commission percentage dtype real, sales year to date dtype real, Sales Last Year dtype real, rowguid dtype text, modified date dtype datetime, SalesPersonQuotaHistory table SalesPersonQuotaHistory Cols: Business Entity ID dtype integer, Quota Date dtype datetime, Sales Quota dtype real, rowguid dtype text, modified date dtype datetime, SalesTerritoryHistory table SalesTerritoryHistory Cols: Business Entity ID dtype integer, Territory ID dtype integer, Start Date dtype datetime, End Date dtype datetime, rowguid dtype text, modified date dtype datetime, ScrapReason table ScrapReason Cols: Scrap Reason ID dtype integer, Name dtype text, modified date dtype datetime, Shift table Shift Cols: ShiftID dtype integer, Name dtype text, Start Time dtype text, End Time dtype text, modified date dtype datetime, ShipMethod table ShipMethod Cols: Ship Method ID dtype integer, Name dtype text, Ship Base dtype real, Ship Rate dtype real, rowguid dtype text, modified date dtype datetime, SpecialOffer table SpecialOffer Cols: Special Offer ID dtype integer, Description dtype text, Discount precentage dtype real, Type dtype text, Category dtype text, Start Date dtype datetime, End Date dtype datetime, Min Quality dtype integer, Max Quality dtype integer, rowguid dtype text, modified date dtype datetime, BusinessEntityAddress table BusinessEntityAddress Cols: Business Entity ID dtype integer, Address ID dtype integer, Address Type ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesTaxRate table SalesTaxRate Cols: Sales Tax Rate ID dtype integer, State Province ID dtype integer, Tax Type dtype integer, Tax Rate dtype real, Name dtype text, rowguid dtype text, modified date dtype datetime, Store table Store Cols: Business Entity ID dtype integer, Name dtype text, Sales Person ID dtype integer, Demographics dtype text, rowguid dtype text, modified date dtype datetime, SalesOrderHeaderSalesReason table SalesOrderHeaderSalesReason Cols: Sales Order ID dtype integer, Sales Reason ID dtype integer, modified date dtype datetime, TransactionHistoryArchive table TransactionHistoryArchive Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, UnitMeasure table UnitMeasure Cols: Unit Measure Code dtype text, Name dtype text, modified date dtype datetime, ProductCostHistory table ProductCostHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, Standard Cost dtype real, modified date dtype datetime, ProductDocument table ProductDocument Cols: Product ID dtype integer, Document Node dtype text, modified date dtype datetime, ProductInventory table ProductInventory Cols: Product ID dtype integer, Location ID dtype integer, Shelf dtype text, Bin dtype integer, Quantity dtype integer, rowguid dtype text, modified date dtype datetime, ProductProductPhoto table ProductProductPhoto Cols: Product ID dtype integer, Product Photo ID dtype integer, Primary dtype integer, Modified Date dtype datetime, ProductReview table ProductReview Cols: Product Review ID dtype integer, Product ID dtype integer, Reviewer Name dtype text, Review Date dtype datetime, Email Address dtype text, Rating dtype integer, Comments dtype text, modified date dtype datetime, ShoppingCartItem table ShoppingCartItem Cols: Shopping CartItem ID dtype integer, Shopping Cart ID dtype text, Quantity dtype integer, Product ID dtype integer, Date Created dtype datetime, modified date dtype datetime, SpecialOfferProduct table SpecialOfferProduct Cols: Special Offer ID dtype integer, Product ID dtype integer, rowguid dtype text, modified date dtype datetime, SalesOrderDetail table SalesOrderDetail Cols: SalesOrderID dtype integer, SalesOrderDetailID dtype integer, CarrierTrackingNumber dtype text, OrderQty dtype integer, ProductID dtype integer, SpecialOfferID dtype integer, UnitPrice dtype real, UnitPriceDiscount dtype real, LineTotal dtype real, rowguid dtype text, ModifiedDate dtype datetime, TransactionHistory table TransactionHistory Cols: Transaction ID dtype integer, Product ID dtype integer, Reference Order ID dtype integer, Reference Order Line ID dtype integer, Transaction Date dtype datetime, Transaction Type dtype text, Quantity dtype integer, Actual Cost dtype real, modified date dtype datetime, Vendor table Vendor Cols: BusinessEntityID dtype integer, AccountNumber dtype text, Name dtype text, CreditRating dtype integer, Preferred Vendor Status dtype integer, Active Flag dtype integer, PurchasingWebServiceURL dtype text, modified date dtype datetime, ProductVendor table ProductVendor Cols: Product ID dtype integer, Business Entity ID dtype integer, Average Lead Time dtype integer, Standard Price dtype real, Last Receipt Cost dtype real, Last Receipt Date dtype datetime, Min Order Quantity dtype integer, Max Order Quantity dtype integer, On Order Quantity dtype integer, Unit Measure Code dtype text, modified date dtype datetime, PurchaseOrderHeader table PurchaseOrderHeader Cols: Purchase Order ID dtype integer, Revision Number dtype integer, Status dtype integer, Employee ID dtype integer, Vendor ID dtype integer, Ship Method ID dtype integer, Order Date dtype datetime, Ship Date dtype datetime, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, modified date dtype datetime, PurchaseOrderDetail table PurchaseOrderDetail Cols: Purchase Order ID dtype integer, Purchase Orde rDetail ID dtype integer, Due Date dtype datetime, Order Quantity dtype integer, Product ID dtype integer, Unit Price dtype real, Line Total dtype real, ReceivedQty dtype real, RejectedQty dtype real, StockedQty dtype real, ModifiedDate dtype datetime, WorkOrder table WorkOrder Cols: Work Order ID dtype integer, Product ID dtype integer, Order Quantity dtype integer, Stocked Quantity dtype integer, Scrapped Quantity dtype integer, Start Date dtype datetime, End Date dtype datetime, Due Date dtype datetime, Scrap Reason ID dtype integer, modified date dtype datetime, WorkOrderRouting table WorkOrderRouting Cols: WorkOrderID dtype integer, ProductID dtype integer, Operation Sequence dtype integer, Location ID dtype integer, Scheduled Start Date dtype datetime, Scheduled End Date dtype datetime, Actual Start Date dtype datetime, ActualEndDate dtype datetime, Actual Resource Hours dtype real, Planned Cost dtype real, ActualCost dtype real, modified date dtype datetime, Customer table Customer Cols: Customer ID dtype integer, Person ID dtype integer, Store ID dtype integer, Territory ID dtype integer, Account Number dtype text, rowguid dtype text, modified date dtype datetime, ProductListPriceHistory table ProductListPriceHistory Cols: Product ID dtype integer, Start Date dtype date, End Date dtype date, ListPrice dtype real, modified date dtype datetime, Address table Address Cols: address id dtype integer, address line 1 dtype text, address line 2 dtype text, City dtype text, state province id dtype integer, postal code dtype text, spatial location dtype text, rowguid dtype text, modified date dtype datetime, AddressType table AddressType Cols: address type id dtype integer, Name dtype text, rowguid dtype text, modified date dtype datetime, BillOfMaterials table BillOfMaterials Cols: bill of materials id dtype integer, product assembly id dtype integer, component ID dtype integer, start date dtype datetime, end date dtype datetime, unit measure code dtype text, bill of materials level dtype integer, per assembly quantity dtype real, modified date dtype datetime, BusinessEntity table BusinessEntity Cols: business entity id dtype integer, rowguid dtype text, modified date dtype datetime, ContactType table ContactType Cols: Contact Type ID dtype integer, Name dtype text, modified date dtype datetime, CurrencyRate table CurrencyRate Cols: Currency Rate ID dtype integer, Currency Rate Date dtype datetime, From Currency Code dtype text, ToCurrencyCode dtype text, Average Rate dtype real, End Of Day Rate dtype real, modified date dtype datetime, Department table Department Cols: Department ID dtype integer, Name dtype text, Group Name dtype text, modified date dtype datetime, EmployeeDepartmentHistory table EmployeeDepartmentHistory Cols: Business Entity ID dtype integer, DepartmentI D dtype integer, Shift ID dtype integer, Start Date dtype date, End Date dtype date, modified date dtype datetime, EmployeePayHistory table EmployeePayHistory Cols: Business Entity ID dtype integer, Rate Change Date dtype datetime, Rate dtype real, Pay Frequency dtype integer, modified date dtype datetime, JobCandidate table JobCandidate Cols: Job Candidate ID dtype integer, Business Entity ID dtype integer, Resume dtype text, modified date dtype datetime, Location table Location Cols: Location ID dtype integer, Name dtype text, Cost Rate dtype real, Availability dtype real, modified date dtype datetime, PhoneNumberType table PhoneNumberType Cols: Phone Number Type ID dtype integer, Phone Number dtype text, modified date dtype datetime, Product table Product Cols: Product ID dtype integer, Name dtype text, Product Number dtype text, Make Flag dtype integer, Finished Goods Flag dtype integer, Color dtype text, Safety Stock Level dtype integer, Reorder Point dtype integer, Standard Cost dtype real, List Price dtype real, Size dtype text, Size Unit Measure Code dtype text, Weight Unit Measure Code dtype text, Weight dtype real, Days To Manufacture dtype integer, Product Line dtype text, Class dtype text, Style dtype text, Product Subcategory ID dtype integer, Product Model ID dtype integer, Sell Start Date dtype datetime, Sell End Date dtype datetime, Discontinued Date dtype datetime, rowguid dtype text, modified date dtype datetime, Document table Document Cols: Document Node dtype text, Document Level dtype integer, Title dtype text, Owner dtype integer, Folder Flag dtype integer, File Name dtype text, File Extension dtype text, Revision dtype text, Change Number dtype integer, Status dtype integer, Document Summary dtype text, Document dtype blob, rowguid dtype text, modified date dtype datetime, StateProvince table StateProvince Cols: State Province ID dtype integer, State Province Code dtype text, Country Region Code dtype text, Is Only State Province Flag dtype integer, Name dtype text, Territory ID dtype integer, rowguid dtype text, modified date dtype datetime, CreditCard table CreditCard Cols: Credit Card ID dtype integer, Card Type dtype text, Card Number dtype text, Expiration Month dtype integer, Expiration Year dtype integer, modified date dtype datetime, SalesOrderHeader table SalesOrderHeader Cols: Sales Order ID dtype integer, RevisionNumber dtype integer, Order Date dtype datetime, DueDate dtype datetime, Ship Date dtype datetime, Status dtype integer, OnlineOrderFlag dtype integer, SalesOrderNumber dtype text, PurchaseOrderNumber dtype text, AccountNumber dtype text, CustomerID dtype integer, SalesPersonID dtype integer, TerritoryID dtype integer, BillToAddressID dtype integer, ShipToAddressID dtype integer, Ship Method ID dtype integer, CreditCardID dtype integer, CreditCardApprovalCode dtype text, CurrencyRateID dtype integer, SubTotal dtype real, Tax Amount dtype real, Freight dtype real, Total Due dtype real, Comment dtype text, rowguid dtype text, modified date dtype datetime,