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

program 6 dbms

The document is a PL/SQL script that calculates an employee's salary details based on their SSN. It computes various salary components including basic salary, DA, HRA, gross salary, net salary, total income, and income tax. The results are then outputted using DBMS_OUTPUT statements.

Uploaded by

Shwetha V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

program 6 dbms

The document is a PL/SQL script that calculates an employee's salary details based on their SSN. It computes various salary components including basic salary, DA, HRA, gross salary, net salary, total income, and income tax. The results are then outputted using DBMS_OUTPUT statements.

Uploaded by

Shwetha V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

DECLARE

sn varchar(20);
emp_name VARCHAR2(50);
basic_salary NUMBER;
da NUMBER;
hra NUMBER;
gross_salary NUMBER;
professional_tax CONSTANT NUMBER := 2000;
pf CONSTANT NUMBER := 1800;
net_salary NUMBER;
total_income NUMBER;
income_tax NUMBER;
BEGIN

SELECT ssn,ename, Salary INTO sn,emp_name,basic_salary FROM EMPLOYEEE WHERE ssn =


&SSN;

da := basic_salary * 0.98;
hra := basic_salary * 0.30;
gross_salary := basic_salary + da + hra;
net_salary := gross_salary - professional_tax - pf;
total_income := net_salary * 12;

IF total_income < 250000 THEN


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

DBMS_OUTPUT.PUT_LINE('Employee Id: ' || sn);


DBMS_OUTPUT.PUT_LINE('Employee Name: ' || emp_name);
DBMS_OUTPUT.PUT_LINE('Basic Salary: ' || basic_salary);
DBMS_OUTPUT.PUT_LINE('DA: ' || da);
DBMS_OUTPUT.PUT_LINE('HRA: ' || hra);
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('Total Income Tax: ' || income_tax);

END;

You might also like