Question: This is for MySQL for the AdventureWorks2017 Database A new manager believes that Special Offers have been underutilized. During a Special Offer meeting, you are
This is for MySQL for the AdventureWorks2017 Database
A new manager believes that Special Offers have been underutilized. During a Special Offer meeting, you are asked to create a report about Special Offers NOT assigned to products. Use a subquery along with an EXISTS operation to determine if a special offer is assigned to a product. Once Special Offers not assigned to products have been identified, report the following information:
a. SpecialOfferID
b. SpecialOfferDescription
c. SpecialOfferEndDate
d. All results must reflect Special Offers that have not yet ended, with discounts greater than 0%. To evaluate ending dates, assume today is January 1, 2012. Use Sales.SpecialOffer and Sales.SpecialOfferProduct


Table Sales.SpecialOffer (16 rows) Sale discounts lookup table. PK Column Data Type Identity Nullable Default Special OfferID int Primary key for SpecialOffer records. Description nvarchar(255) Discount description. DiscountPct smallmoney 0.00 Discount precentage. Type nvarchar(50) Discount type category. Category Group the discount applies to such as Reseller or Customer. StartDate datetime Discount start date. EndDate datetime Discount end date. Min Qty int 0 Minimum discount percent allowed. MaxQty int Maximum discount percent allowed. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. ch as Reseller or cnvarchar(50) HHHHHHH UK Table Sales.SpecialOfferProduct (538 rows) Cross-reference table mapping products to special offer discounts. PK, FK PK, FK int Column Data Type Identity Nullable Default SpecialOfferID int Primary key for SpecialOfferProduct records. ProductID Product identification number. Foreign key to Product ProductID. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. UK Table Sales.SpecialOffer (16 rows) Sale discounts lookup table. PK Column Data Type Identity Nullable Default Special OfferID int Primary key for SpecialOffer records. Description nvarchar(255) Discount description. DiscountPct smallmoney 0.00 Discount precentage. Type nvarchar(50) Discount type category. Category Group the discount applies to such as Reseller or Customer. StartDate datetime Discount start date. EndDate datetime Discount end date. Min Qty int 0 Minimum discount percent allowed. MaxQty int Maximum discount percent allowed. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. ch as Reseller or cnvarchar(50) HHHHHHH UK Table Sales.SpecialOfferProduct (538 rows) Cross-reference table mapping products to special offer discounts. PK, FK PK, FK int Column Data Type Identity Nullable Default SpecialOfferID int Primary key for SpecialOfferProduct records. ProductID Product identification number. Foreign key to Product ProductID. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. UK
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
