Solved

design promo code dataabse

Posted on 2014-09-23
6
435 Views
Last Modified: 2014-10-13
I want to design a database to include the promo code. The rule that I want to use are the following. The promo code can be used by referring someone to sign up, it can apply to the entire product, or to the specific session or by geographic location.

Please advise
0
Comment
Question by:erikTsomik
6 Comments
 
LVL 1

Expert Comment

by:Richard Francis
Comment Utility
Hi Erik,

I'm not totally clear what your promo code actually does, could you flesh that out a bit? For example does it reduce the price of your product/service, or entitle the user to extra features?

Richard.
0
 
LVL 19

Author Comment

by:erikTsomik
Comment Utility
it will reduce the price of the product
0
 
LVL 29

Expert Comment

by:Olaf Doschke
Comment Utility
Be as concrete descirbing what the promo code can do, as you can.

Promocodes reducing the price of a product would need the following simple table:

promocode, productid, discount

That would be all there is to it in regard of database schema. On top of that you of course need a page or form element to accept the promo code, code to check whether the promo code can be applied to a current order and delete it, if it's valid once only. OR you need a validthru date, if it's a promotion with a deadline. You can't expect a database design going into such details if you have no concrete idea about what you want.

You also talked about the validity for a certain session only or a geographic region. It's not self explanatory just to chunk out the key words. Tell more.

Bye, Olaf.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 19

Author Comment

by:erikTsomik
Comment Utility
I wan to have a promo code to give discounts (% or $) and incorporate the referral discount (where both parties will get a creadit. I Need a mechanism to track it who is using it and from who is came from)
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 total points
Comment Utility
Then your promocode table will just need some more fields:

promocode, originatoruserid, productid, discountpercent (nullable), discountabsolute (nullable)

some (new) user entering the promocode then gets the discount and you know which originator user also gets a discount. This still doesn't cover any geographical dependency.

Bye, Olaf.
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 250 total points
Comment Utility
I would be inclined to break it up a little more (normalise).

Promo Master (describes what it is and where is applies - code, description, discount value, discount type, start & expiry dates)
Promo Detail (describes how it is used - code, referrer, consumer, date)

If promo's are going to be allocated to referrers, or referrers have some kind of constraint, then you may need a "Promo Referrer" table to set up those relationships as well.

You might also consider a "Promo Reimbursement" where you can track each claim and claim type as the promo's are being paid / realised.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now