I am learning and practicing some database designing and case study on Selling Services on Internet. In my requirement, user can buy a post service and add more extra option if they need. In fact, post are divided into a few type, for example, 7days, 14days and 30days post. Because of this, I create table ProductCategory and table Product.

Product Category table:

  • ProductCategoryID
  • Name

Product table:

  • ProductID
  • Name
  • Price
  • Duration
  • Discount
  • ProductCategoryID

And I also add two more table for payment and payment detail:

Payment table:

  • PaymentID
  • AccountID
  • PaymentDate

Payment Detail table:

  • PaymentDetailID
  • QTY
  • PaymentID
  • ProductID

I think above design may work but I am not sure if this is good or not as I still need to learn more about it. But, problem isn't stop here, the problem is that I am thinking of allow user to buy a service in form of package which will be cheaper in price. For example, user may buy a 7days post for 1$ + extra option for 1$ but if they buy a package for 5$ then they can get 5 post that displays for 14days with 5 extra option. And that package will be expired in 7days so user must use it or it will be expired.

I have add another BigPackage table as following design:

  • BigPackageID
  • ProductID1(must have product category name = package)
  • ProductID2(must not have product category name = package)
  • QTY

Doing so I saw lot of flaw and the difficulty to get available package and calculate the price they have spend. So now if anyone has any idea please kindly light my way and I do appreciate your help.

  • Establishing some analogies, you may find of help this answer. – MDCCL Feb 14 at 15:48
  • 1
    @MDCCL it's a big help! I could not find it anywhere especially the keyword. Anyway, great job, thank your! – tammary Feb 14 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.