In the example we can see in a table we apply the calculation rule and it automatically fetch the all the details salary.
Suppose we have a salary table like below.
CREATE TABLE [dbo].[T_Employee] (
[empId] INT IDENTITY (1, 1) NOT NULL,
[empName] VARCHAR (50) NOT NULL,
[Salary] INT NOT NULL,
[DeptName] VARCHAR (50) NOT NULL,
[Designation] VARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([empId] ASC)
);
CREATE TABLE [dbo].[T_Employee] (
[empId] INT IDENTITY (1, 1) NOT NULL,
[empName] VARCHAR (50) NOT NULL,
[Salary] INT NOT NULL,
[DeptName] VARCHAR (50) NOT NULL,
[Designation] VARCHAR (50) NOT NULL,
[HRA] AS ([Salary]*(0.2)),
[TA] AS ([Salary]*(0.15)),
[DA] AS ([Salary]*(0.18)),
[GrossSalary] AS ((([Salary]+[Salary]*(0.2))+[Salary]*(0.15))+[Salary]*(0.18)),
[TDS] AS (((([Salary]+[Salary]*(0.2))+[Salary]*(0.15))+[Salary]*(0.18))*(0.25)),
[NetSalary] AS (((([Salary]+[Salary]*(0.2))+[Salary]*(0.15))+[Salary]*(0.18))-
((([Salary]+[Salary]*(0.2))+[Salary]*(0.15))+[Salary]*(0.18))*(0.25)),
PRIMARY KEY CLUSTERED ([empId] ASC)
);
Employee Table: When put any value to salary then it calculate automatically all the details. |
Notes: HRA, TA, DA, Gross, Net and TDS salary calculation formula must be check before going to apply.
Post a Comment