Link to home
Create AccountLog in
Microsoft SQL Server 2005

Microsoft SQL Server 2005

--

Questions

--

Followers

Top Experts

Avatar of rdracer58
rdracer58

Complex database table design question.
We are trying to add a couple of new tables to an existing database to help us track sales commission related data. The database already has three pre-existing tables, PJEMPLOY, PJPROJEM, and PJPROJ (please see the attached diagram). All employees (account managers/recruiters, consultants, etc.) are listed in the PJEMPLOY table and all company projects are listed in the PJPROJ table.

We need to be able to track which employees are either account managers or recruiters, which consultants they earn a commission off of, and what percentage of each specific consultant's salary (it varies per consultant) is earned as a commission for each account manager/recruiter.

What is the best way to structure these tables for querying/reporting purposes? Any new data will be manually entered, however, we would like to easily be able to at least be able to generate queried rows of the following data: account manager/recruiter name (already contained in PJEMPLOY), Consultant Name (already in PJEMPLOY table, we just need a means of determining who is an account manager who is a consultant), Employee Sales Plan (this will be the % the account manager will earn, currently not stored in any table), and Employee Salary (this is the consultant's salary, currently not stored anywhere).

Any insights would be appreciated!
Commission-Tracking-Table-Layout.jpg

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of dportasdportas

It looks like you are pretty close already. As far as I can tell you already have the tables you require and you just need to add the attributes that you've identified as missing from the model. If you're having trouble determining where new attributes belong then write down the dependencies first and be guided by normalization principles, ie. aim to be in at least BNCF or Fifth Normal Form.

Avatar of rdracer58rdracer58

ASKER

The issue I am wrestling with is how to connect both the "Consultant" and "Account Manager" tables to the "PJEMPLOY" table. Is there any simpler way to do this, with creating fewer new tables?

ASKER CERTIFIED SOLUTION
Avatar of dportasdportas

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Was able to condense it down to the "Manager/Consultant" table--CEMPLOY and AMEMPLOY tables were definitely redundant. Thanks!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Microsoft SQL Server 2005

Microsoft SQL Server 2005

--

Questions

--

Followers

Top Experts

Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.