Assuming you have a business that rents movie and you were designing a schema for your database. The customer will have to choose a plan, a delivery type, and a billingTerm (monthly, every three months, every six months). The plan has a base price and decides how many movies a customer can rent per month, and how many at once. The delivery type will change the price based on the customers choice (a regular delivery will add a certain value to the plan price, and expedited one will add a higher value. Would it be better to store the delivery type and billing terms information in the plans table, or in the customers table?
Assuming the following tables:
billingTerms(id, billEveryXMonths, discount)
deliveryTypes(id, type, price)
Approach one:
plans(id, name, price, billingTermsId, deliveryTypeId, monthlyLimit, atHomeLimit)
customers(id, name, planId)
This approach is much simpler, but essentially ends up duplicating the plans save for one attribute. The number of permutations and combinations is greater than having just two plans.
Approach two is to store plan id, delivery type, and billing terms in the customer table:
plans(id, name, price)
customers(id, name, planId, billingTermId, deliveryTypeId)
Additionally, the monthlyLimit and atHomeLimit will have to be linked to a controls table that keeps track of a customers activity each month.