0% found this document useful (0 votes)
2 views

program 8 dbms

The document defines a PL/SQL procedure named Calculate_Tax that calculates an employee's gross salary, net salary, total income, and income tax based on their basic salary and employee ID. It includes constants for professional tax and provident fund deductions, and computes allowances for dearness and house rent. The results are displayed using DBMS_OUTPUT for the employee's tax details.

Uploaded by

Shwetha V
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

program 8 dbms

The document defines a PL/SQL procedure named Calculate_Tax that calculates an employee's gross salary, net salary, total income, and income tax based on their basic salary and employee ID. It includes constants for professional tax and provident fund deductions, and computes allowances for dearness and house rent. The results are displayed using DBMS_OUTPUT for the employee's tax details.

Uploaded by

Shwetha V
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

CREATE OR REPLACE PROCEDURE Calculate_Tax(

emp_id IN NUMBER,
basic_salary IN NUMBER
)
IS
gross_salary NUMBER(10,2);
net_salary NUMBER(10,2);
total_income NUMBER(12,2);
income_tax NUMBER(12,2);
da NUMBER(10,2);
hra NUMBER(10,2);
professional_tax CONSTANT NUMBER := 2000;
pf CONSTANT NUMBER := 1800;
BEGIN
-- Calculate DA and HRA
da := basic_salary * 0.98;
hra := basic_salary * 0.30;

-- Calculate Gross Salary


gross_salary := basic_salary + da + hra;

-- Calculate Net Salary


net_salary := gross_salary - professional_tax - pf;

-- Calculate Total Income


total_income := net_salary * 12;

-- Calculate Income Tax


IF total_income < 250000 THEN
income_tax := 0;
ELSE
income_tax := (total_income - 250000) * 0.20;
END IF;

-- Display Employee Tax Details


DBMS_OUTPUT.PUT_LINE('Employee ID: ' || emp_id);
DBMS_OUTPUT.PUT_LINE('Basic Salary: ' || basic_salary);
DBMS_OUTPUT.PUT_LINE('Gross Salary: ' || gross_salary);
DBMS_OUTPUT.PUT_LINE('Net Salary: ' || net_salary);
DBMS_OUTPUT.PUT_LINE('Total Income: ' || total_income);
DBMS_OUTPUT.PUT_LINE('Income Tax: ' || income_tax);
END;

You might also like