سؤال

Suppose you have two tables:

Purchase(cardID,itemID)

MembershipCard(cardID,clientID,companyName)

How can I get all cardID's which were not used in a purchase using relational algebra?

It seems like division to me but I'm not sure

هل كانت مفيدة؟

المحلول

You have to take all MembershipCards and remove all the ones that are in Purchase:

πcardID(MembershipCard) - πcardID(Purchase)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top