Example
Example
Example
Test Output:
2.Example
Test Output:
3.Example
Write a pl/sql program to get the area of the circle provided the radius is given.
Test Output:
4.Example
Write a pl/sql program to get the name and salary of specified employee.
Test Output:
5.Example
Write a pl/sql program to get the name and salary of specified employee using %type attribute.
Test Output:
6.Example
Write a pl/sql program to get the name and salary of specified employee
Test Output:
7.Example
Write a pl/sql program Accept Number from a User and display Hello message if the entered
number is Positive.
Test Output:
8.Example
Write a pl/sql program to Display Salary of a specified employee increasing by 500 if its salary
Test Output:
9.Example
Write a pl/sql program to Accept number from a user and find out whether it is Odd or Even.
Test Output:
10.Example
Write a pl/sql program to Accept employee number from a user and increase its salary depends
on
Salary Increment
Test Output:
Test Output:
Test Output:
Test Output:
Exception Handling
14.Example
Write a PL/SQL Block to accept employee name from a user if it is exist display its salar y
Test Output:
15.Example
Write a PL/SQL Block to display the salary of that employee whose age is 45 year otherwise
display appropriate message using exception handling.
Test Output:
16.Example
Write a PL/SQL Block to insert add one row in employee table with employee number and
number.
Test Output:
Database Triggers:
Example
Test Output:
17.Example
Test Output:
18.Example
Emp.
Test Output:
19.Example
Test Output:
20.Examples:
Test Output:
SQL> @trigger
Trigger created.
Test Output:
Test Output:
row
Test Output:
Example
Test Output:
Test Output:
Test Output:
Aim:
26.To write a Cursor to display the list of Male and Female Passengers.
Test Output:
Test Output:
SQL>@Passenger
Test Output:
even.
Test Output:
Test Output:
Example
30.Make a procedure, which will accept a number and return it’s Square.
Test Output:
Example
Test Output:
Test Output:
32.Example
Create a Procedure, which receives employee number and display employee name,
SQL>exec empdata(1051)
Test output:
Example
33.Write a PL/SQL block, which will use a user-defined procedure, which accept employee
number and return employee name and department name in a out parameter.
Test output:
34.Example
Create a procedure, which receives department number and get total Salary of that
Test output:
35.Example
Write procedure to accept Department number and display Name, Designation and Age of
Test output:
SQL>exec dept_list(20);
Test output:
36.Example
Create a procedure, which will accept Deptno and Display no of employee under different
grade.
Test output:
Test output:
38.Example
Test output:
Test output:
39.Example
Write a Function to find out maximum salary for the passed designation.
Test output:
Test output:
40.Example
Create a Function to find out existence of employee whose name is passed as a parameter
Test output:
41.Example
Write a Function to find out Total salary for the passed department Name.
Test output:
Example
Test output:
Example
43.Write a Function to find out total annual income for the employee, who’s number we passed.
Test output:
Test output:
Example
44.Create a function, which receives three arguments, first two as a number and third as a
arithmetic.
Test output:
Additional Experiments:
45.Create relations for the following schemas and write queries for retrieving data.
Student(sid,sname,address)
Course(cid,cname,fee)
Enrolled(cid,sid,doj)
46.Apply key constraints & participation constraints for the following relations.
emp(eid,ename,sal)
dept(did,dname,location)
manages(did,eid,day)
47.Create relations for the following schemas and write quaries for retrieving.
Professor ( SSN,Nmae,Age,Rank)
Graduate (SSN,Name,Age,Degree)
48.Create relations for the following schemas and write queries for retrieving
Supplies(Sid,Sname,Address)
Parts(pid,Pname,color)
Catalog(sid,pid,cost)
49.Create relations for the following schemas and write queries for retrieving
Boats( bid,bname,color)
Reserves(sid,bid,day)
50.Create relations for the following schemas and write queries for retrieving
Flights(flno,from,to,distance,departs,arrives)
Aircraft(aid,anme,cruisingrange)
Certified(eid,aid)
Employees(eid,enmae,salary)