Dbms Record Outputs
Dbms Record Outputs
Name Type
Empno Number
Ename Varchar2(10)
Job Varchar2(10)
Mgr Number
Sal Number
Name Type
Deptno Number
Deptname Varchar2(20)
location Varchar2(20)
1.
a. Create a user and grant all permissions to the user.
b. Insert the any two records in the employee table and use rollback. Check the
result.
c. Add primary key constraint and not null constraint to the employee table.
d. Insert null values to the employee table and verify the result.
2.
a. Create a user and grant all permissions to the user.
c. Delete any three records in the department table and use rollback.
d. Add constraint primary key and foreign key to the table.
QUERIES USING AGGREGATE FUNCTIONS
1. a. By using the group by clause, display the enames who belongs to deptno 10
along with average salary.
c. Show the average salary for all departments employing more than three
people.
d. Display employees who earn more than the lowest salary in department 30
e. Show that value returned by sign (n)function.
f. By using the group by clause, display the eid who belongs to deptno 05 along
with average salary.
4.
a. Count the number of employees in department 20
d. List the minimum and maximum salaries for each job type.
e. List the employee names in descending order.
b. Write a PL/SQL code block to calculate the area of a circle for a value of
radius varying from 3 to 7. Store the radius and the corresponding values of
calculated area in an empty table named areas, consisting of two columns radius
and area.
5. a. Write a PL/SQL program to accept a string and remove the vowels from
the string. (When “hello” passed to the program it should display “Hll”
removing e and o from the word Hello).
b. Write a PL/SQL program to accept a number and a divisor. Make sure the
divisor is less than or equal to 10. Else display an error message. Otherwise
Display the remainder in words.
PROCEDURES AND FUNCTIONS
1. Create a row level trigger for the customers table that would fire for INSERT
or UPDATE or DELETE operations performed on the CUSTOMERS table. This
trigger will display the salary difference between the old values and new values:
CUSTOMERS table: