Question: Normalize the following table and design the new layout StoreMembership table [ [ StoreName , Storeld,Memberld,MemberName,MemberGroup,IsDisabled ] , [ Target , 1 1 2

Normalize the following table and design the new layout
StoreMembership
\table[[StoreName,Storeld,Memberld,MemberName,MemberGroup,IsDisabled],[Target,112,A001,MickeyMouse,NULL,0],[Walmart,113,A001,MickeyMouse,Neighborhood,0],[Target,112,A002,DonaldDuck,NULL,1],[Neighborhood,114,A001,MickeyMouse,NULL,0],[Neighborhood,114,A003,Ariel,NULL,0],[Neighborhood,114,A002,DonaldDuck,NULL,0],[Target,112,A003,Ariel,NULL,1],[Walmart,113,A004,Ariel,NULL,0],[Walmart,113,A005,Goofy,Neighborhood,1],[Walmart,113,A006,Minnie,NULL,0],[Target,112,A004,Ariel,NULL,NULL]]
Each member can access the membership benefits by directly becoming a member of the store or becoming a member the store's subsidiary shop (Neighborhood is a subsidiary of Walmart). When the customer is no longer a member of the store, the membership becomes disabled.
2. Write a query to show number of active membership directly purchased by Walmart.
3. Write a query to show distinct list of customers with membership to Target and indirect active membership to Walmart.
4. Write a query to show number of customers who had membership in both Walmart and Target.
5. Write a query to a distinct list of customers with number of active membership order by count of membership descending.
Normalize the following table and design the new

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!