What relation of (income and Deduction) and payroll table

Posted by Ahmedsa under Sql Server on 12/4/2014 | Points: 10 | Views : 949 | Status : [Member] | Replies : 1
I already make payroll database i have all tables but one relation in this database i don't know how to make relation

between payroll table and deduction and income

Employee Table

Employee ID




Salary Table(1 to 1 Employee Table)

Salary ID

Employee ID


Income Table(N to 1 Employee Table)

Income ID

Employee ID


Over Time

From Date

To Date

Deduction Table ( N to 1 Employee Table)

Deduction ID


From Date

To Date

Payroll Table(I don't know Relation)

And this is my question how to collect Deduction and income from two tables

and make relation to Payroll table

Meaning what relation between Payroll and( Deduction And Income)

How to collect two foreign key of income and Deduction in Payroll Table

Are relation one to many or what


Posted by: Wadhwanisanju on: 12/18/2014 [Member] Starter | Points: 25

You need to create a table with PayrollID, EmployeeID, TotalDeduction and TotalIncome columns.

You have to map or insert or update Payroll Table's two columns i.e.

TotalDeduction = sum(All Deduction of Employee) by passing emplyoyeeid

TotalIncome = sum(All Income of Employee) by passing emplyoyeeid


Let me know if you need help in this.

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response