In my current web application, I have to create a "Reputation Points & Badges Engine" somewhat similar to SO. That system contains many rules and each rule is associated with a few predefined user activities (like view question, vote question, etc).
What I am trying to figure out the solution for:
Any hints would be appreciate?
Database doesn't seem to be the appropriate tool for this requirement. Seems like you will need to implement such logic in application layer. of course, certain parameter values can come from config files.
One way if this is what you really really want to do, is to have variables (such as views, votes) defined in columns. The output your badge assigned or reputation point can also be column but the function of other columns.
so table would look like: