473,831 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

employee commissions

RR
I am wondering what tables and relationships I would have to have to keep
track of one or several employees commissions per transaction.

One tracsaction can have one or several employees work on it, and the
commissions for each employee depends on how many employees worked on it.

Thanks
Nov 13 '05 #1
2 1425
Hi,

I'd suggest considering something like this:

Employee table with EmployeeID as primary key and EmployeeName etc.
Transaction table with TransactionID as primary key and EmployeeID as
foreign key.

The question arises with regard how to treat the commissions. If the
commission is calculated based on the number of employees working on the
transaction then this sounds like calculated data, i.e. unknown until all
the relevant employeeIDs have been entered. If you need the commission
amount for queries and reports then it can be a calculated value rather than
a field stored in the database. If you must store it in the database then I
think you need an update query to update the commission amounts after all
the employeeIDs have been entered - this assumes the commission is shared
equally between the employees.

HTH -Linda

"RR" <te**********@y ahoo.com> wrote in message
news:cp******** *********@fe2.t exas.rr.com...
I am wondering what tables and relationships I would have to have to keep
track of one or several employees commissions per transaction.

One tracsaction can have one or several employees work on it, and the
commissions for each employee depends on how many employees worked on it.

Thanks

Nov 13 '05 #2
"RR" <te**********@y ahoo.com> wrote in message news:<cp******* **********@fe2. texas.rr.com>.. .
I am wondering what tables and relationships I would have to have to keep
track of one or several employees commissions per transaction.

One tracsaction can have one or several employees work on it, and the
commissions for each employee depends on how many employees worked on it.

Thanks


Employee---(M,M)---Transaction

So...

Employee--(1,M)---WorksOn---(M,1)---Transaction

So...

CREATE TABLE Employee(
EmployeeID Autonumber PRIMARY KEY,
FirstName Text(25) NOT NULL,
LastName Text(25) NOT NULL,
....
);

CREATE TABLE Transaction(
TransactionID Autonumber PRIMARY KEY,
....);

CREATE TABLE WorksOn(
EmpID LONG INTEGER,
TransID LONG INTEGER,
PRIMARY KEY (EmpID, TransID)
FOREIGN KEY (EmpID) REFERENCES Employee(Employ eeID),
(TransID) REFERENCES Transaction(Tra nsactionID));

And then the amount of the commission each gets is 1/n * value of
commission. Where n is the count of values in WorksOn for the given
TransID.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1162
by: Morten Gulbrandsen | last post by:
USE company; DROP TABLE IF EXISTS EMPLOYEE; CREATE TABLE EMPLOYEE ( # PK SSN CHAR(9) NOT NULL, # FK SUPERSSN CHAR(9), DNO INT NOT NULL DEFAULT 1, CONSTRAINT EMPPK
1
14940
by: Chris Strug | last post by:
Hi, As something of a pet project, I'm looking to develop a tool to track employee holiday (or vacation for those of us in the US) for my company - good for the company (if I get something usuable working) and good practice for me. Before I even open Access I want to get the relationships sorted. First looks indicate two basic entities:
17
19321
by: RSH | last post by:
I am really trying to grasp the concept of OOP as it applies to C#. I am looking at trying to set up a simple Employee Class but I am having trouble conceptualizing what this class should look like. I was hoping someone might be able to simply outline what I envision my class to look like: Basically I am envisioning a Class called Employee: I imagine it would have many properties(?) such as:
3
4069
by: jhhbr549 | last post by:
Can some help me with this. Please review this code for errors. I can not get it to complie. Here is my Code .. This is an abstract class that is used in conjuntion with 4 other classes.. They are Hourly, IAm, Salaried, Sales. import java.util.*; //Constructors //Constructor public abstract class Employee
0
1633
by: mkarki2 | last post by:
I am doing a likned list program in C. I am not really good at it and just started. But I am stuck how to pass structure in the function correctly. this is the driver file #ifndef DRIVER_C #define DRIVER_C #include "constants.c" int main(void) {
4
2271
by: Jromero | last post by:
Hi I am getting this error message ...can anyone help me out????? C:\Documents and Settings\Jessica Romero\Desktop\Employee.java:23: cannot find symbol symbol : method sethourlySalary(double) location: class Employee sethourlySalary(hourlyS); ^ C:\Documents and Settings\Jessica Romero\Desktop\Employee.java:24: cannot find symbol
0
1679
by: howkoss | last post by:
Hi, I've been very frustrated for 2 days trying to make this work. I started with a built-in template "Projects" that came with Access 2007. On the "Employee List" I can click on any cell and bring up the Employee Detail" corresponding to that particular cell. That works fine. I want to be able to open "Employee Detail" when I click on a cell in "Project Detail". I got to the point that "Employee Detail" opens but only to the frst record. PLEASE...
1
2187
by: bartholomeus | last post by:
Hello all, I would greatly appreciate suggestions on my following PHP4 problem: In PHP5 this works: $employee = $dom->getElementsByTagName('employee')->item(0); In PHP4 this doesn't work: $employee = $dom->get_elements_by_tagname('employee')->item(0);
9
3952
by: menkenk | last post by:
Hello, I have a query that I used to calculate the monthly, quarterly, semi-annual, annual commissions by agent. Below is the SQL view of this Query. SELECT ., .Plan, .Placed, .Monthly, (-7.65)* AS , .Quarterly, (-22.53)* AS , ., (-44.2)* AS , .Annual, (-85)* AS , .CTP, (*) AS FROM INNER JOIN ON .AgentID = .Agent WHERE (((Format())=) AND ((Format(,"mm/yyyy")) Between And )); The issue I have is that under the PLAN field, we have a UL...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10494
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10534
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7748
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5620
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.