(收入和扣除)和工资表的关系 [英] What relation of (income and Deduction) and payroll table
问题描述
我已经制作了工资单数据库我有所有的表但是这个数据库中的一个关系我不知道如何建立关系
工资表与扣除和收入之间
员工表
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
Name
Address
Nationality
薪资表(1对1员工表)
Salary Table(1 to 1 Employee Table)
Salary ID
Employee ID
Salary
收入表(N对1员工)表)
Income Table(N to 1 Employee Table)
Income ID
Employee ID
Bonus
Over Time
From Date
To Date
扣除表(N对1员工表)
Deduction Table ( N to 1 Employee Table)
Deduction ID
Employee ID
Deduction
From Date
To Date
薪资表(我不喜欢不知道关系)
这是我的问题如何收集两张桌子的扣除和收入并与Payr建立联系oll table
意味着薪资和(扣除和收入)之间的关系
如何收集两个外国人工资表中的收入和扣除的关键
关系一对多或者是什么
添加了代码块 - OriginalGriff [/ edit]
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
[edit]Code block added - OriginalGriff[/edit]
推荐答案
我们不能说 - 我们不知道你的工资表会包含什么,或者你要去做什么用它来做。
首先考虑一下它需要包含哪些信息,这应该给你一个线索。如果您绘制各种表格的图表(以及SQL Server Management Studio可以为您执行此操作),这可能会有所帮助 - 但我不相信薪资表:
如果与员工的1to1,为什么要这样呢?改为将Salary字段添加到Employee表中会更简单。
当工资变化时会发生什么?当然,你想为人们保留一些薪水:它能否在月中改变?如果是这样,那么月工资的一半是旧税率,一半是新税率。我自己,我可能会在Nto1工资表中找到一个有效起始日期。
We can't say - we have no idea what your payroll table is going to contain, or what you are going to use it for.
So start by thinking about what information it needs to contain, and that should give you a clue. If you draw a diagram (and SQL Server Management Studio can do that for you) of your various tables it may help - but I'm not convinced by the Salary Table:
If it's 1to1 with Employee, why have it at all? It would be simpler to add a Salary field to the Employee table instead.
And what happens when a salary changes? Surely, you want to keep a number of salaries for people: could it change in mid month? If so, then half the monthly wage is at the old rate, and half at the new. Myself, I'd probably have a "effective from" date in a Nto1 salary table instead.
这篇关于(收入和扣除)和工资表的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!