Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views1 page

PLSQL Fun and Procedures

The document outlines SQL commands to create an 'employee' table and insert records into it. It also describes a PL/SQL procedure to add new employee records and a function to update employee salaries with a 15% hike. The procedure and function are successfully executed, demonstrating the manipulation of employee data in the database.

Uploaded by

Sumanth
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)
12 views1 page

PLSQL Fun and Procedures

The document outlines SQL commands to create an 'employee' table and insert records into it. It also describes a PL/SQL procedure to add new employee records and a function to update employee salaries with a 15% hike. The procedure and function are successfully executed, demonstrating the manipulation of employee data in the database.

Uploaded by

Sumanth
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

11111111111

create table employee( name varchar2(20),id number,location varchar2(20));

insert into employee values('uma',2,'guntur');


insert into employee values('sumanth',1,'penumaka');
insert into employee values('semya',3,'hyd');

create or replace procedure empl(nam employee.name%type,i_d employee.id%type,loc


employee.location%type)
is
begin
insert into employee values(nam,i_d,loc);
end empl;

Procedure created

begin
empl('pavani',4,'vjw');
end;
/

PL/SQL procedure successfully completed.

SQL> select * from employee;

NAME ID LOCATION
-------------------- ---------- --------------------
uma 2 guntur
sumanth 1 penumaka
semya 3 hyd
pavani 4 vjw

2222222222222222

create or replace function sal_hike(emp_id emp.employee_id%type)


return number
is
salary emp.salary%type;
begin
update emp set salary = (salary+(0.15*salary));
return salary;
end;

begin
dbms_output.put_line(sal_hike(101));
end;

You might also like