I have a superclass Promotion and it has 3 subclasses GiftCard, Offers, TodaysDeals.
Promotion(PromotionID,expiryDate)
GiftCard(GiftCardID,points)
where GiftCard.giftcardID references promotion
TodaysDeals(TodaysDealsID,Discount)
where TodaysDeals.TodaysDealsID references promotion
Offers(OffersID,Discount)
where offers.offersID references promotion
GiftCard promotions are related to customers while Offers & Deals are related to the product. A product can't have an offer and a deal at the same time. I want to add the promotionID into the table of Products, ensuring that any promotionID corresponding to the GiftCardID isn't in the table. Is that approach possible to be represented in the eerd and translated to sql code?
I thought of doing a relation between deals and product and another between offer and product, but that won't satisfy the constraint that a product can't have an offer and a deal at the same time, because both ID's will be represented as foreign keys in the Product Table.