input
stringlengths
358
16.1k
output
stringlengths
24
805
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the name of the subcategory to which the gray product with the lowest safety stock level belongs? [/INST]
SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the product cost end date with the highest weight in grams? [/INST]
SELECT T2.EndDate FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WeightUnitMeasureCode = 'G' ORDER BY T1.Weight DESC LIMIT 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the percentage of the total products ordered were not rejected by Drill size? [/INST]
SELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Calculate the average of the total ordered quantity of products purchased whose shipping method was Cargo Transport 5. [/INST]
SELECT CAST(SUM(IIF(T1.ShipMethodID = 5, T3.OrderQty, 0)) AS REAL) / COUNT(T3.ProductID) FROM ShipMethod AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.ShipMethodID = T2.ShipMethodID INNER JOIN PurchaseOrderDetail AS T3 ON T2.PurchaseOrderID = T3.PurchaseOrderID;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: List the name of the rates that apply to the provinces that are in the territory that obtained the greatest increase in sales with respect to the previous year. [/INST]
SELECT T2.Name FROM SalesTerritory AS T1 INNER JOIN StateProvince AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode INNER JOIN SalesTaxRate AS T3 ON T2.StateProvinceID = T3.StateProvinceID ORDER BY (T1.SalesYTD - T1.SalesLastYear) / T1.SalesLastYear DESC LIMIT 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many employees earn their salaries on a monthly basis at an hourly rate of more than 50? [/INST]
SELECT COUNT(BusinessEntityID) FROM EmployeePayHistory WHERE rate * PayFrequency > 50;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the employee of company number 1's full name? [/INST]
SELECT FirstName, MiddleName, LastName FROM Person WHERE BusinessEntityID = 1 AND PersonType = 'EM';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the name of the supplier number 1492? [/INST]
SELECT NAME FROM Vendor WHERE BusinessEntityID = 1492;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many vendors only consented to move on with the 500 to 15000 piece order in terms of quality? [/INST]
SELECT COUNT(*) FROM ProductVendor WHERE MinOrderQty > 500 AND MaxOrderQty < 15000;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the departments that are part of the Executive General and Administration group. [/INST]
SELECT Name FROM Department WHERE GroupName = 'Executive General and Administration';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the family names of any employees whose middle names begin with C. [/INST]
SELECT LastName FROM Person WHERE PersonType = 'EM' AND MiddleName LIKE 'C%';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many vendors are having their products ordered with an average delivery time of 25 days? [/INST]
SELECT COUNT(DISTINCT BusinessEntityID) FROM ProductVendor WHERE AverageLeadTime = 25;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list any 3 product numbers with the lowest standard cost. [/INST]
SELECT ProductID FROM ProductCostHistory ORDER BY StandardCost ASC LIMIT 3;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many black-colored products are there that cannot be sold? [/INST]
SELECT COUNT(ProductID) FROM Product WHERE FinishedGoodsFlag = 0 AND Color = 'Black';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the top three employees with the most unused sick leave along with their position titles. [/INST]
SELECT JobTitle FROM Employee ORDER BY SickLeaveHours DESC LIMIT 3;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the full address of address number 11906? [/INST]
SELECT AddressLine1, AddressLine2 FROM Address WHERE AddressID = 11906;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is business number 1580's net profit? [/INST]
SELECT LastReceiptCost - StandardPrice FROM ProductVendor WHERE BusinessEntityID = 1580;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the sales revenue for item number 740? [/INST]
SELECT ListPrice - StandardCost FROM Product WHERE ProductID = 740;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many customers gave a product the best possible rating? Please list their names. [/INST]
SELECT ReviewerName FROM ProductReview WHERE Rating = 5;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the company that Adventure Works deal with that have poor credit rating? Please provide their business number. [/INST]
SELECT BusinessEntityID FROM Vendor WHERE CreditRating = ( SELECT CreditRating FROM Vendor ORDER BY CreditRating DESC LIMIT 1 );
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the forename and birthdate of person number 18? [/INST]
SELECT T1.FirstName, T2.BirthDate FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.BusinessEntityID = 18;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What job is person number 322 currently holding? [/INST]
SELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID WHERE T2.BusinessEntityID = 332;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list 3 businesses along with their IDs that use cellphones. [/INST]
SELECT T2.BusinessEntityID FROM PhoneNumberType AS T1 INNER JOIN PersonPhone AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID WHERE T1.Name = 'Cell' LIMIT 3;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the currency of Brazil? [/INST]
SELECT T1.Name FROM Currency AS T1 INNER JOIN CountryRegionCurrency AS T2 ON T1.CurrencyCode = T2.CurrencyCode INNER JOIN CountryRegion AS T3 ON T2.CountryRegionCode = T3.CountryRegionCode WHERE T3.Name = 'Brazil';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many people work in the finance department? [/INST]
SELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T1.Name = 'Finance';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How long does it take for the business to receive the item it has purchased? Who is the vendor for business number 1496? [/INST]
SELECT T1.AverageLeadTime, T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 USING (businessentityid) WHERE T2.BusinessEntityID = 1496 GROUP BY T1.AverageLeadTime, T2.Name;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many accounts are in Bothell as opposed to Kenmore? What is the name of the State that comprises these two cities? [/INST]
SELECT SUM(IIF(T1.city = 'Bothell', 1, 0)) - SUM(IIF(T1.city = 'Kenmore', 1, 0)) , stateprovincecode FROM Address AS T1 INNER JOIN StateProvince AS T2 ON T1.stateprovinceid = T2.stateprovinceid GROUP BY stateprovincecode;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which chromoly steel product model has AdventureWorks saved in English? [/INST]
SELECT T1.ProductModelID FROM ProductModelProductDescriptionCulture AS T1 INNER JOIN Culture AS T2 USING (cultureid) INNER JOIN ProductDescription AS T3 USING (productdescriptionid) WHERE T3.Description LIKE 'Chromoly steel%' AND T2.Name = 'English';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the total number of companies with a commission percentage of 0.018 or above, along with each company's assigned geographical location. [/INST]
SELECT T1.BusinessEntityID, T2.'Group' FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 USING (territoryid) WHERE T1.CommissionPct >= 0.018;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the various phone number types in the following order, from most to least common among businesses. [/INST]
SELECT T2.Name FROM PersonPhone AS T1 INNER JOIN PhoneNumberType AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which role has the most common contact among businesses? [/INST]
SELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC LIMIT 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the salespeople's email addresses? [/INST]
SELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SP';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which position does Suchitra hold? [/INST]
SELECT T2.JobTitle FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Suchitra';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many employees work for AdvertureWorks that is single? [/INST]
SELECT COUNT(T1.BusinessentityID) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'EM' AND T2.MaritalStatus = 'S';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How much do the works data saved in English and Arabic differ from one another? [/INST]
SELECT SUM(CASE WHEN T1.Name = 'English' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID WHERE T1.Name = 'English' OR T1.Name = 'Arabic';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the location of business number 1? [/INST]
SELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 USING (AddressID) WHERE T2.BusinessEntityID = 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please list the businesses along with their numbers that have their accounts located in Duvall. [/INST]
SELECT T2.BusinessEntityID FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T1.City = 'Duvall';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What percentage of the AdventureWorks data is in Thai? [/INST]
SELECT CAST(SUM(CASE WHEN T1.Name = 'Thai' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.CultureID) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What percentage of AdventureWorks employees are men? [/INST]
SELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessentityID) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessentityID = T2.BusinessentityID WHERE T1.PersonType = 'EM';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Where is the address 15873 located, in what city and state? Does that city belong to a province where the code exists? [/INST]
SELECT T2.City, T1.Name, T1.IsOnlyStateProvinceFlag FROM StateProvince AS T1 INNER JOIN Address AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T2.AddressID = 15873;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the full address of business number 24? [/INST]
SELECT T1.AddressLine1, T1.AddressLine2 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T2.BusinessEntityID = 24;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which year is credit card No.9648's Expiration Year? [/INST]
SELECT ExpYear FROM CreditCard WHERE CreditCardID = 9648;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What's Emma H Harris's Business Entity ID number? [/INST]
SELECT BusinessEntityID FROM Person WHERE FirstName = 'Emma' AND LastName = 'Harris';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the location id for Debur and Polish? [/INST]
SELECT LocationID FROM Location WHERE Name = 'Debur and Polish';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the Department ids under the Sales and Marketing Group? [/INST]
SELECT DepartmentID FROM Department WHERE GroupName = 'Sales and Marketing';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which sales person made the sale of 1635823.3967 last year? Give the Business Entity ID. [/INST]
SELECT BusinessEntityID FROM SalesPerson WHERE SalesLastYear = '1635823.3967';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the Shift start time for Shift ID No.2? [/INST]
SELECT StartTime FROM Shift WHERE ShiftID = '2';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is contact Type ID No.16 represent for? [/INST]
SELECT Name FROM ContactType WHERE ContactTypeID = '16';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the minimum shipping charge for "OVERSEAS - DELUXE"? [/INST]
SELECT ShipBase FROM ShipMethod WHERE Name = 'OVERSEAS - DELUXE';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Please tell the meaning of CultureID "fr". [/INST]
SELECT Name FROM Culture WHERE CultureID = 'fr';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Give the Mauritius Rupee's currency code. [/INST]
SELECT CurrencyCode FROM Currency WHERE Name = 'Mauritius Rupee';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Name cellphone number's Type ID? [/INST]
SELECT PhoneNumberTypeID FROM PhoneNumberType WHERE Name = 'Cell';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For the older production technician who was hired in 2008/12/7, what's his/her birthday? [/INST]
SELECT BirthDate FROM Employee WHERE HireDate = '2008-12-07';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the product ID No.793's model name? [/INST]
SELECT T1.Name FROM Product AS T1 INNER JOIN ProductModel AS T2 ON T1.ProductModelID = T2.ProductModelID WHERE T1.ProductID = 793;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the unit measure codes for product ID No.762? [/INST]
SELECT T2.UnitMeasureCode FROM Product AS T1 INNER JOIN UnitMeasure AS T2 ON T1.SizeUnitMeasureCode = T2.UnitMeasureCode OR T1.WeightUnitMeasureCode = T2.UnitMeasureCode WHERE T1.ProductID = 762 GROUP BY T1.ProductID, T2.UnitMeasureCode;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Where is Business Entity ID No.4 located at? Give the address down to street. [/INST]
SELECT AddressLine1, AddressLine2 FROM Address WHERE AddressID IN ( SELECT AddressID FROM BusinessEntityAddress WHERE BusinessEntityID = 4 );
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For the on going assembly item Component ID No. 494, what's the Unit measure for it? [/INST]
SELECT T2.Name FROM BillOfMaterials AS T1 INNER JOIN UnitMeasure AS T2 ON T1.UnitMeasureCode = T2.UnitMeasureCode WHERE T1.ComponentID = 494 AND T1.EndDate IS NULL GROUP BY T2.name;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For the document Control Assistant who was born on 1975/12/25, how many private documents did he/she have? [/INST]
SELECT COUNT(T2.BusinessEntityID) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Assistant' AND T2.BirthDate = '1975-12-25' AND T1.DocumentSummary IS NULL;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: To the products which could make the profit as 21.9037, what were their list price after October of 2012? [/INST]
SELECT T1.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ListPrice - T1.StandardCost > 21.9037 AND STRFTIME('%Y-%m-%d', T2.StartDate) >= '2012-10-01';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the size of the photo of product id No.1? [/INST]
SELECT T1.ThumbNailPhoto FROM ProductPhoto AS T1 INNER JOIN ProductProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T2.ProductID = 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many letters are there in Catherine Ward's e-mail account passwords? [/INST]
SELECT LENGTH(T2.PasswordHash) FROM Person AS T1 INNER JOIN Password AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Catherine' AND T1.LastName = 'Ward';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What rating did Jill give for HL Mountain Pedal? [/INST]
SELECT T1.Rating FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ReviewerName = 'Jill' AND T2.Name = 'HL Mountain Pedal';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What's the profit for the Freewheel? [/INST]
SELECT T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Freewheel';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Did Rachel Valdez complete her sales task? [/INST]
SELECT T1.Bonus FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Rachel' AND T2.LastName = 'Valdez';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many types of tax did the sales happen in Quebec have? [/INST]
SELECT COUNT(DISTINCT T1.Name) FROM SalesTaxRate AS T1 INNER JOIN StateProvince AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T2.Name = 'Quebec';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What's Kevin A Wright's email address? [/INST]
SELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Kevin' AND T1.MiddleName = 'A' AND T1.LastName = 'Wright';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the number of State Province of France that doesn't have a State Province Code? [/INST]
SELECT T1.CountryRegionCode FROM StateProvince AS T1 INNER JOIN CountryRegion AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode WHERE T2.Name = 'France' AND T1.IsOnlyStateProvinceFlag = 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What kind of transaction type for the "HL Road Frame - Black, 48" order happened in 2012/12/13? [/INST]
SELECT T1.TransactionType FROM TransactionHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'HL Road Frame - Black, 48' AND STRFTIME('%Y-%m-%d',T1.TransactionDate) = '2013-07-31';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which type of transaction was it for the "LL Road Handlebars" order happened in 2012/11/3? [/INST]
SELECT T1.TransactionType FROM TransactionHistoryArchive AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'LL Road Handlebars' AND STRFTIME('%Y-%m-%d',T1.TransactionDate) = '2012-11-03';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How is the Credit Rating for company whose rowguid is "33671A4E-DF2B-4879-807B-E3F930DD5C0C"? [/INST]
SELECT T1.CreditRating FROM Vendor AS T1 INNER JOIN BusinessEntity AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.rowguid = '33671A4E-DF2B-4879-807B-E3F930DD5C0C';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the PreferredVendorStatus for the company which has the rowguid of "684F328D-C185-43B9-AF9A-37ACC680D2AF"? [/INST]
SELECT T1.PreferredVendorStatus FROM Vendor AS T1 INNER JOIN BusinessEntity AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.rowguid = '684F328D-C185-43B9-AF9A-37ACC680D2AF';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For person id No.2054, is his/her vendor still active? [/INST]
SELECT T1.ActiveFlag FROM Vendor AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonID = 2054;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Show me the phone number of Gerald Patel's. [/INST]
SELECT T2.PhoneNumber FROM Person AS T1 INNER JOIN PersonPhone AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Gerald' AND T1.LastName = 'Patel';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which is Business Entity ID No.13626's phone number type? [/INST]
SELECT T2.Name FROM PersonPhone AS T1 INNER JOIN PhoneNumberType AS T2 USING (PhoneNumberTypeID) WHERE T1.BusinessEntityID = 13626;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What's Lynn N Tsoflias's job title? [/INST]
SELECT T2.JobTitle FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Lynn' AND T1.MiddleName = 'N' AND T1.LastName = 'Tsoflias';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the number of the sub categories for bikes? [/INST]
SELECT COUNT(*) FROM ProductCategory AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductCategoryID = T2.ProductCategoryID WHERE T1.Name = 'Bikes';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For the document Control Assistant who was hired on 2009/1/22, what is the percentage of private documents did he/she have? [/INST]
SELECT CAST(SUM(CASE WHEN T1.DocumentSummary IS NOT NULL THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.DocumentSummary) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Assistant' AND T2.HireDate = '2009-01-22';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How much is HL Grip Tape's profit ratio? [/INST]
SELECT (T1.LastReceiptCost - T1.StandardPrice) / T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'HL Grip Tape';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: For all phone numbers, what percentage of the total is cell phone? [/INST]
SELECT CAST(SUM(CASE WHEN T2.Name = 'Cell' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Name) FROM PersonPhone AS T1 INNER JOIN PhoneNumberType AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the product assembly ID that come with unit measure code EA and BOM level of 2, at the same time have per assembly quantity of more than 10? [/INST]
SELECT ProductAssemblyID FROM BillOfMaterials WHERE UnitMeasureCode = 'EA' AND BOMLevel = 2 AND PerAssemblyQty > 10;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many location IDs have actual resource hours of 2? [/INST]
SELECT COUNT(LocationID) FROM WorkOrderRouting WHERE ActualResourceHrs = 2;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the stocked quantity of products manufactured from location ID 40? [/INST]
SELECT COUNT(*) FROM WorkOrderRouting AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.LocationID = T2.ProductAssemblyID INNER JOIN WorkOrder AS T3 ON T3.WorkOrderID = T1.WorkOrderID WHERE T1.LocationID = 40;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What are the total per assembly quantity for unit measure code EA, IN and OZ respectively? What are the name of these 3 code? [/INST]
SELECT SUM(T1.PerAssemblyQty), T2.Name FROM BillOfMaterials AS T1 INNER JOIN UnitMeasure AS T2 ON T1.UnitMeasureCode = T2.UnitMeasureCode WHERE T1.UnitMeasureCode IN ('EA', 'IN', 'OZ') GROUP BY T2.Name;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which product ID do not have any work order ID? [/INST]
SELECT ProductID FROM Product WHERE ProductID NOT IN ( SELECT T1.ProductID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID );
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the name of product purchased with transaction type P? [/INST]
SELECT ProductID FROM Product WHERE ProductID IN ( SELECT ProductID FROM TransactionHistory WHERE TransactionType = 'P' );
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: State the full name of accountants in the company. [/INST]
SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Accountant';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the job position currently occupied by Ken J Sánchez? [/INST]
SELECT T1.JobTitle FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Ken' AND T2.MiddleName = 'J' AND T2.LastName = 'Sánchez';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many male employees do not wish to receive e-mail promotion? [/INST]
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 0 AND T1.Gender = 'M';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Who is the top sales person who achived highest percentage of projected sales quota in 2013? [/INST]
SELECT BusinessEntityID FROM SalesPerson WHERE BusinessEntityID IN ( SELECT BusinessEntityID FROM SalesPersonQuotaHistory WHERE STRFTIME('%Y', QuotaDate) = '2013' ) ORDER BY CAST(SalesLastYear AS REAL) / SalesQuota DESC LIMIT 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many of the non-sales employees are married? [/INST]
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'EM' AND T1.MaritalStatus = 'M';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Among the Production Technicians who are single, how many of them are vendor contact? [/INST]
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' AND T1.MaritalStatus = 'S' AND T2.PersonType = 'VC';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the total sick leave hours of employees who do not wish to receive any e-mail promotion? [/INST]
SELECT SUM(T1.SickLeaveHours) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 0;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Among the sales people, who are hired prior to 2010? [/INST]
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP' AND SUBSTR(T1.HireDate, 0, 4) < 2010;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Which sales person achieved the highest sales YTD? What is the projected yearly sales quota in 2011 for this person? [/INST]
SELECT T1.BusinessEntityID, SUM(T1.SalesQuota) FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.QuotaDate) = '2011' GROUP BY T1.BusinessEntityID ORDER BY SUM(T1.SalesYTD) DESC LIMIT 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many people with the name Alex are single and occupying organization level of 1? [/INST]
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Alex' AND T1.MaritalStatus = 'S' AND T1.OrganizationLevel = 1;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: What is the average vacation hours taken by Sales person? [/INST]
SELECT CAST(SUM(T1.VacationHours) AS REAL) / COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: State the last name and job title of owner for document "Crank Arm and Tire Maintenance". [/INST]
SELECT T1.LastName, T3.JobTitle FROM Person AS T1 INNER JOIN Document AS T2 ON T1.BusinessEntityID = T2.Owner INNER JOIN Employee AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Title = 'Crank Arm and Tire Maintenance';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: How many employees do not have any suffix and what are their organization level? [/INST]
SELECT COUNT(T3.BusinessEntityID) FROM ( SELECT T1.BusinessEntityID FROM Employee AS T1 INNER JOIN Person AS T2 USING (BusinessEntityID) WHERE T2.Suffix IS NULL GROUP BY T1.BusinessEntityID ) AS T3;
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Among the sales people who achieved projected sales quota 2013, is there any person from territory ID 1? If yes, state the business entity ID. [/INST]
SELECT DISTINCT T1.BusinessEntityID FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.TerritoryID = 1 AND STRFTIME('%Y', QuotaDate) = '2013';
[INST] Here is a database schema: CountryRegion : CountryRegionCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Culture : CultureID [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Currency : CurrencyCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CountryRegionCurrency : CountryRegionCode [ TEXT ] CountryRegionCurrency.CountryRegionCode = CountryRegion.CountryRegionCode CurrencyCode [ TEXT ] CountryRegionCurrency.CurrencyCode = Currency.CurrencyCode ModifiedDate [ DATETIME ] Person : BusinessEntityID [ INTEGER ] primary_key Person.BusinessEntityID = BusinessEntity.BusinessEntityID PersonType [ TEXT ] NameStyle [ INTEGER ] Title [ TEXT ] FirstName [ TEXT ] MiddleName [ TEXT ] LastName [ TEXT ] Suffix [ TEXT ] EmailPromotion [ INTEGER ] AdditionalContactInfo [ TEXT ] Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityContact : BusinessEntityID [ INTEGER ] BusinessEntityContact.BusinessEntityID = BusinessEntity.BusinessEntityID PersonID [ INTEGER ] BusinessEntityContact.PersonID = Person.BusinessEntityID ContactTypeID [ INTEGER ] BusinessEntityContact.ContactTypeID = ContactType.ContactTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] EmailAddress : BusinessEntityID [ INTEGER ] EmailAddress.BusinessEntityID = Person.BusinessEntityID EmailAddressID [ INTEGER ] EmailAddress [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Employee : BusinessEntityID [ INTEGER ] primary_key Employee.BusinessEntityID = Person.BusinessEntityID NationalIDNumber [ TEXT ] LoginID [ TEXT ] OrganizationNode [ TEXT ] OrganizationLevel [ INTEGER ] JobTitle [ TEXT ] BirthDate [ DATE ] MaritalStatus [ TEXT ] Gender [ TEXT ] HireDate [ DATE ] SalariedFlag [ INTEGER ] VacationHours [ INTEGER ] SickLeaveHours [ INTEGER ] CurrentFlag [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Password : BusinessEntityID [ INTEGER ] primary_key Password.BusinessEntityID = Person.BusinessEntityID PasswordHash [ TEXT ] PasswordSalt [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] PersonCreditCard : BusinessEntityID [ INTEGER ] PersonCreditCard.BusinessEntityID = Person.BusinessEntityID CreditCardID [ INTEGER ] PersonCreditCard.CreditCardID = CreditCard.CreditCardID ModifiedDate [ DATETIME ] ProductCategory : ProductCategoryID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductDescription : ProductDescriptionID [ INTEGER ] primary_key Description [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModel : ProductModelID [ INTEGER ] primary_key Name [ TEXT ] CatalogDescription [ TEXT ] Instructions [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductModelProductDescriptionCulture : ProductModelID [ INTEGER ] ProductModelProductDescriptionCulture.ProductModelID = ProductModel.ProductModelID ProductDescriptionID [ INTEGER ] ProductModelProductDescriptionCulture.ProductDescriptionID = ProductDescription.ProductDescriptionID CultureID [ TEXT ] ProductModelProductDescriptionCulture.CultureID = Culture.CultureID ModifiedDate [ DATETIME ] ProductPhoto : ProductPhotoID [ INTEGER ] primary_key ThumbNailPhoto [ BLOB ] ThumbnailPhotoFileName [ TEXT ] LargePhoto [ BLOB ] LargePhotoFileName [ TEXT ] ModifiedDate [ DATETIME ] ProductSubcategory : ProductSubcategoryID [ INTEGER ] primary_key ProductCategoryID [ INTEGER ] ProductSubcategory.ProductCategoryID = ProductCategory.ProductCategoryID Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesReason : SalesReasonID [ INTEGER ] primary_key Name [ TEXT ] ReasonType [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritory : TerritoryID [ INTEGER ] primary_key Name [ TEXT ] CountryRegionCode [ TEXT ] SalesTerritory.CountryRegionCode = CountryRegion.CountryRegionCode Group [ TEXT ] SalesYTD [ REAL ] SalesLastYear [ REAL ] CostYTD [ REAL ] CostLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPerson : BusinessEntityID [ INTEGER ] primary_key SalesPerson.BusinessEntityID = Employee.BusinessEntityID TerritoryID [ INTEGER ] SalesPerson.TerritoryID = SalesTerritory.TerritoryID SalesQuota [ REAL ] Bonus [ REAL ] CommissionPct [ REAL ] SalesYTD [ REAL ] SalesLastYear [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesPersonQuotaHistory : BusinessEntityID [ INTEGER ] SalesPersonQuotaHistory.BusinessEntityID = SalesPerson.BusinessEntityID QuotaDate [ DATETIME ] SalesQuota [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTerritoryHistory : BusinessEntityID [ INTEGER ] SalesTerritoryHistory.BusinessEntityID = SalesPerson.BusinessEntityID TerritoryID [ INTEGER ] SalesTerritoryHistory.TerritoryID = SalesTerritory.TerritoryID StartDate [ DATETIME ] EndDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ScrapReason : ScrapReasonID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Shift : ShiftID [ INTEGER ] primary_key Name [ TEXT ] StartTime [ TEXT ] EndTime [ TEXT ] ModifiedDate [ DATETIME ] ShipMethod : ShipMethodID [ INTEGER ] primary_key Name [ TEXT ] ShipBase [ REAL ] ShipRate [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SpecialOffer : SpecialOfferID [ INTEGER ] primary_key Description [ TEXT ] DiscountPct [ REAL ] Type [ TEXT ] Category [ TEXT ] StartDate [ DATETIME ] EndDate [ DATETIME ] MinQty [ INTEGER ] MaxQty [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BusinessEntityAddress : BusinessEntityID [ INTEGER ] BusinessEntityAddress.BusinessEntityID = BusinessEntity.BusinessEntityID AddressID [ INTEGER ] BusinessEntityAddress.AddressID = Address.AddressID AddressTypeID [ INTEGER ] BusinessEntityAddress.AddressTypeID = AddressType.AddressTypeID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesTaxRate : SalesTaxRateID [ INTEGER ] primary_key StateProvinceID [ INTEGER ] SalesTaxRate.StateProvinceID = StateProvince.StateProvinceID TaxType [ INTEGER ] TaxRate [ REAL ] Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Store : BusinessEntityID [ INTEGER ] primary_key Store.BusinessEntityID = BusinessEntity.BusinessEntityID Name [ TEXT ] SalesPersonID [ INTEGER ] Store.SalesPersonID = SalesPerson.BusinessEntityID Demographics [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderHeaderSalesReason : SalesOrderID [ INTEGER ] SalesOrderHeaderSalesReason.SalesOrderID = SalesOrderHeader.SalesOrderID SalesReasonID [ INTEGER ] SalesOrderHeaderSalesReason.SalesReasonID = SalesReason.SalesReasonID ModifiedDate [ DATETIME ] TransactionHistoryArchive : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] UnitMeasure : UnitMeasureCode [ TEXT ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] ProductCostHistory : ProductID [ INTEGER ] ProductCostHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] StandardCost [ REAL ] ModifiedDate [ DATETIME ] ProductDocument : ProductID [ INTEGER ] ProductDocument.ProductID = Product.ProductID DocumentNode [ TEXT ] ProductDocument.DocumentNode = Document.DocumentNode ModifiedDate [ DATETIME ] ProductInventory : ProductID [ INTEGER ] ProductInventory.ProductID = Product.ProductID LocationID [ INTEGER ] ProductInventory.LocationID = Location.LocationID Shelf [ TEXT ] Bin [ INTEGER ] Quantity [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductProductPhoto : ProductID [ INTEGER ] ProductProductPhoto.ProductID = Product.ProductID ProductPhotoID [ INTEGER ] ProductProductPhoto.ProductPhotoID = ProductPhoto.ProductPhotoID Primary [ INTEGER ] ModifiedDate [ DATETIME ] ProductReview : ProductReviewID [ INTEGER ] primary_key ProductID [ INTEGER ] ProductReview.ProductID = Product.ProductID ReviewerName [ TEXT ] ReviewDate [ DATETIME ] EmailAddress [ TEXT ] Rating [ INTEGER ] Comments [ TEXT ] ModifiedDate [ DATETIME ] ShoppingCartItem : ShoppingCartItemID [ INTEGER ] primary_key ShoppingCartID [ TEXT ] Quantity [ INTEGER ] ProductID [ INTEGER ] ShoppingCartItem.ProductID = Product.ProductID DateCreated [ DATETIME ] ModifiedDate [ DATETIME ] SpecialOfferProduct : SpecialOfferID [ INTEGER ] SpecialOfferProduct.SpecialOfferID = SpecialOffer.SpecialOfferID ProductID [ INTEGER ] SpecialOfferProduct.ProductID = Product.ProductID rowguid [ TEXT ] ModifiedDate [ DATETIME ] SalesOrderDetail : SalesOrderID [ INTEGER ] SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID SalesOrderDetailID [ INTEGER ] primary_key CarrierTrackingNumber [ TEXT ] OrderQty [ INTEGER ] ProductID [ INTEGER ] SalesOrderDetail.ProductID = SpecialOfferProduct.ProductID SpecialOfferID [ INTEGER ] SalesOrderDetail.SpecialOfferID = SpecialOfferProduct.SpecialOfferID UnitPrice [ REAL ] UnitPriceDiscount [ REAL ] LineTotal [ REAL ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] TransactionHistory : TransactionID [ INTEGER ] primary_key ProductID [ INTEGER ] TransactionHistory.ProductID = Product.ProductID ReferenceOrderID [ INTEGER ] ReferenceOrderLineID [ INTEGER ] TransactionDate [ DATETIME ] TransactionType [ TEXT ] Quantity [ INTEGER ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Vendor : BusinessEntityID [ INTEGER ] primary_key Vendor.BusinessEntityID = BusinessEntity.BusinessEntityID AccountNumber [ TEXT ] Name [ TEXT ] CreditRating [ INTEGER ] PreferredVendorStatus [ INTEGER ] ActiveFlag [ INTEGER ] PurchasingWebServiceURL [ TEXT ] ModifiedDate [ DATETIME ] ProductVendor : ProductID [ INTEGER ] ProductVendor.ProductID = Product.ProductID BusinessEntityID [ INTEGER ] ProductVendor.BusinessEntityID = Vendor.BusinessEntityID AverageLeadTime [ INTEGER ] StandardPrice [ REAL ] LastReceiptCost [ REAL ] LastReceiptDate [ DATETIME ] MinOrderQty [ INTEGER ] MaxOrderQty [ INTEGER ] OnOrderQty [ INTEGER ] UnitMeasureCode [ TEXT ] ProductVendor.UnitMeasureCode = UnitMeasure.UnitMeasureCode ModifiedDate [ DATETIME ] PurchaseOrderHeader : PurchaseOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] Status [ INTEGER ] EmployeeID [ INTEGER ] PurchaseOrderHeader.EmployeeID = Employee.BusinessEntityID VendorID [ INTEGER ] PurchaseOrderHeader.VendorID = Vendor.BusinessEntityID ShipMethodID [ INTEGER ] PurchaseOrderHeader.ShipMethodID = ShipMethod.ShipMethodID OrderDate [ DATETIME ] ShipDate [ DATETIME ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] ModifiedDate [ DATETIME ] PurchaseOrderDetail : PurchaseOrderID [ INTEGER ] PurchaseOrderDetail.PurchaseOrderID = PurchaseOrderHeader.PurchaseOrderID PurchaseOrderDetailID [ INTEGER ] primary_key DueDate [ DATETIME ] OrderQty [ INTEGER ] ProductID [ INTEGER ] PurchaseOrderDetail.ProductID = Product.ProductID UnitPrice [ REAL ] LineTotal [ REAL ] ReceivedQty [ REAL ] RejectedQty [ REAL ] StockedQty [ REAL ] ModifiedDate [ DATETIME ] WorkOrder : WorkOrderID [ INTEGER ] primary_key ProductID [ INTEGER ] WorkOrder.ProductID = Product.ProductID OrderQty [ INTEGER ] StockedQty [ INTEGER ] ScrappedQty [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] DueDate [ DATETIME ] ScrapReasonID [ INTEGER ] WorkOrder.ScrapReasonID = ScrapReason.ScrapReasonID ModifiedDate [ DATETIME ] WorkOrderRouting : WorkOrderID [ INTEGER ] WorkOrderRouting.WorkOrderID = WorkOrder.WorkOrderID ProductID [ INTEGER ] OperationSequence [ INTEGER ] LocationID [ INTEGER ] WorkOrderRouting.LocationID = Location.LocationID ScheduledStartDate [ DATETIME ] ScheduledEndDate [ DATETIME ] ActualStartDate [ DATETIME ] ActualEndDate [ DATETIME ] ActualResourceHrs [ REAL ] PlannedCost [ REAL ] ActualCost [ REAL ] ModifiedDate [ DATETIME ] Customer : CustomerID [ INTEGER ] primary_key PersonID [ INTEGER ] Customer.PersonID = Person.BusinessEntityID StoreID [ INTEGER ] Customer.StoreID = Store.BusinessEntityID TerritoryID [ INTEGER ] Customer.TerritoryID = SalesTerritory.TerritoryID AccountNumber [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] ProductListPriceHistory : ProductID [ INTEGER ] ProductListPriceHistory.ProductID = Product.ProductID StartDate [ DATE ] EndDate [ DATE ] ListPrice [ REAL ] ModifiedDate [ DATETIME ] Address : AddressID [ INTEGER ] primary_key AddressLine1 [ TEXT ] AddressLine2 [ TEXT ] City [ TEXT ] StateProvinceID [ INTEGER ] PostalCode [ TEXT ] SpatialLocation [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] AddressType : AddressTypeID [ INTEGER ] primary_key Name [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] BillOfMaterials : BillOfMaterialsID [ INTEGER ] primary_key ProductAssemblyID [ INTEGER ] ComponentID [ INTEGER ] StartDate [ DATETIME ] EndDate [ DATETIME ] UnitMeasureCode [ TEXT ] BOMLevel [ INTEGER ] PerAssemblyQty [ REAL ] ModifiedDate [ DATETIME ] BusinessEntity : BusinessEntityID [ INTEGER ] primary_key rowguid [ TEXT ] ModifiedDate [ DATETIME ] ContactType : ContactTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] CurrencyRate : CurrencyRateID [ INTEGER ] primary_key CurrencyRateDate [ DATETIME ] FromCurrencyCode [ TEXT ] ToCurrencyCode [ TEXT ] AverageRate [ REAL ] EndOfDayRate [ REAL ] ModifiedDate [ DATETIME ] Department : DepartmentID [ INTEGER ] primary_key Name [ TEXT ] GroupName [ TEXT ] ModifiedDate [ DATETIME ] EmployeeDepartmentHistory : BusinessEntityID [ INTEGER ] DepartmentID [ INTEGER ] ShiftID [ INTEGER ] StartDate [ DATE ] EndDate [ DATE ] ModifiedDate [ DATETIME ] EmployeePayHistory : BusinessEntityID [ INTEGER ] RateChangeDate [ DATETIME ] Rate [ REAL ] PayFrequency [ INTEGER ] ModifiedDate [ DATETIME ] JobCandidate : JobCandidateID [ INTEGER ] primary_key BusinessEntityID [ INTEGER ] Resume [ TEXT ] ModifiedDate [ DATETIME ] Location : LocationID [ INTEGER ] primary_key Name [ TEXT ] CostRate [ REAL ] Availability [ REAL ] ModifiedDate [ DATETIME ] PhoneNumberType : PhoneNumberTypeID [ INTEGER ] primary_key Name [ TEXT ] ModifiedDate [ DATETIME ] Product : ProductID [ INTEGER ] primary_key Name [ TEXT ] ProductNumber [ TEXT ] MakeFlag [ INTEGER ] FinishedGoodsFlag [ INTEGER ] Color [ TEXT ] SafetyStockLevel [ INTEGER ] ReorderPoint [ INTEGER ] StandardCost [ REAL ] ListPrice [ REAL ] Size [ TEXT ] SizeUnitMeasureCode [ TEXT ] WeightUnitMeasureCode [ TEXT ] Weight [ REAL ] DaysToManufacture [ INTEGER ] ProductLine [ TEXT ] Class [ TEXT ] Style [ TEXT ] ProductSubcategoryID [ INTEGER ] ProductModelID [ INTEGER ] SellStartDate [ DATETIME ] SellEndDate [ DATETIME ] DiscontinuedDate [ DATETIME ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Document : DocumentNode [ TEXT ] primary_key DocumentLevel [ INTEGER ] Title [ TEXT ] Owner [ INTEGER ] FolderFlag [ INTEGER ] FileName [ TEXT ] FileExtension [ TEXT ] Revision [ TEXT ] ChangeNumber [ INTEGER ] Status [ INTEGER ] DocumentSummary [ TEXT ] Document [ BLOB ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] StateProvince : StateProvinceID [ INTEGER ] primary_key StateProvinceCode [ TEXT ] CountryRegionCode [ TEXT ] IsOnlyStateProvinceFlag [ INTEGER ] Name [ TEXT ] TerritoryID [ INTEGER ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] CreditCard : CreditCardID [ INTEGER ] primary_key CardType [ TEXT ] CardNumber [ TEXT ] ExpMonth [ INTEGER ] ExpYear [ INTEGER ] ModifiedDate [ DATETIME ] SalesOrderHeader : SalesOrderID [ INTEGER ] primary_key RevisionNumber [ INTEGER ] OrderDate [ DATETIME ] DueDate [ DATETIME ] ShipDate [ DATETIME ] Status [ INTEGER ] OnlineOrderFlag [ INTEGER ] SalesOrderNumber [ TEXT ] PurchaseOrderNumber [ TEXT ] AccountNumber [ TEXT ] CustomerID [ INTEGER ] SalesPersonID [ INTEGER ] TerritoryID [ INTEGER ] BillToAddressID [ INTEGER ] ShipToAddressID [ INTEGER ] ShipMethodID [ INTEGER ] CreditCardID [ INTEGER ] CreditCardApprovalCode [ TEXT ] CurrencyRateID [ INTEGER ] SubTotal [ REAL ] TaxAmt [ REAL ] Freight [ REAL ] TotalDue [ REAL ] Comment [ TEXT ] rowguid [ TEXT ] ModifiedDate [ DATETIME ] Please write me a SQL statement that answers the following question: Who are the employees that submitted resume to Human Resource Department and got hired? State the last name. [/INST]
SELECT T3.LastName FROM Employee AS T1 INNER JOIN JobCandidate AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T1.BusinessEntityID IN (212, 274);