Relationship Exceptions

milkman2500

Registered User.
Local time
Today, 09:49
Joined
Oct 21, 2012
Messages
45
Hi,

I'm currently trying to model out the relationships for a sales database. I've walked through the structure with the client and established the relationships. However, I'm concerned about future exceptions and how to position the database to accommodate.

The current model is as follows:

An employee earns a specific rate in a specific role:

John will earn 10% as a sales executive, and 5% as a sales management.So if John sold Client ABC, he will earn 10%. However, if John assisted Adam in selling Client ABC, Adam will earn 10% and John will earn 5% on what Adam earns.

Alternative 1
I've modeled the tables as t_employees, t_clients, t_roles. The rate is within t_roles. So if John is assigned as a sales executive, he will always receive 10%. However, if in the future they want to assign John a 15% rate on a client as an exception, the user would have to create a new role as "Exception 1" and populate the table with the 15% rate, then assign that role to John.

Alternative 2
The alternative, is to create a relationship table (t_sales_lkp), where the employee, client, role and rate will need to be defined every time a new client comes on board. This creates redundancy as the user will need to constantly reapply the same rate over and over again.

Suggestions?
 
It seems you need some sort of table to allow for new Rates for a Role. That implies that you need a DateOfChange to accommodate "New" rate.

A Person is assigned to a Role on a Per Sale basis (my interpretation for example 1).

So John is assigned to the Sales Executive role for a Sale occurring on Date XXX.
You determine the "current rate for that role based on the DateofChange", if the SaleDate (Date XXX) is on or after the DateofChange" then the latest Rate for Sales Executive is used.

Your example 2 indicates that the Rate is also based on the Client. So, in my view, you must determine what exactly identifies Rate. Is Rate simply based on Percentage of SaleAmt, or is Rate dependent on Client, or is Rate some function of both Client and SaleAmt?

From experience, I think you will answer this question by writing down a definition of Rate and reviewing same with your management, since this is a basic "business fact" specific to the business.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom