-- 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 ] |
-- -- What type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units?

SELECT DISTINCT T2.TransactionType FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Size = 62 AND T1.Color = 'Yellow' AND T1.SafetyStockLevel = 500;