You are on page 1of 4

1.

Writing PL/SQL Blocks with basic programming


constructs a. Write a PL/SQL block with Unconstrained loop. b. Write a PL/SQL block which gives idea of Impact of EXIT in a function c. Create a table employee with one of the field as start date and salary. Write a PL/SQL block to increase the salary of the employee whose date of joining is before specified date in the if condition by 15% otherwise increase the salary of the employee by 5%. d. Create a table place with attributes room_id, building, room_number, number_seats, description. Write a PL/SQL block to comment on the type of place as Fairly Small, a little bigger, lots of room depending upon the value of the number_seats for a given room_id. e. Create a table Suppliers. Write a PL/SQL block to insert values in the table by while loop. f. Create a table lecturer with one of the attribute as major subject. Write a PL/SQL block with CASE WHEN statement with variable which print the course name depending upon the major subject for the specified lecturer id. g. Write a PL/SQL block which uses GoTO to jump out of a loop h. Create a table MyTable with attributes num_col and char_col. Write a PL/SQL block to insert values in the table and run NULL as a statement inside one of the IF statement.

2. Procedures and Functions in PL/SQL Block

a. Create an empty procedure or replace a procedure with Hello World and execute the same. b. Write a PL/SQL block to define and call procedure to swap two numbers. c. Write a PL/SQL block to define procedure to insert data in the Employee table. d. Create a table lecturer. Write a PL/SQL block which Create a stored procedure and call it. e. Write a PL/SQL block with number type parameter and insert the values in it. f. Write a PL/SQL block with forward declaration of procedure. g. Write a PL/SQL block for defining and calling simple function. h. Write a PL/SQL block to define and use function in select clause. i. Create a table employee. Write a PL/SQL block which acts as a Recursive function listing which takes two parameters one is of type number and one is of type varchar, to display employee name. j. Create table Customer. Insert 5 meaning full records in it. Write a function to count number of Customers and return value back. k. Create table Book. Insert 5 meaning full records in it. Write a function to count number of Books and store the return value to a variable. l. Write a function and call it in dbms_output.put_line 3. Implementing cursors & sequences

Create a table employee. Insert 5 meaning full records in it. Using implicit cursor Update the salary of the specified employee id if that id is available in the table. And using SQL %FOUND return the appropriate message on the screen. b. Create a table employee. Insert 5 meaning full records in it. Write explicit cursor to accept id of the employee and print its first and last name. c. Create a table employee. Insert 5 meaning full records in it. Create a cursor to display last name of employee till the last record is found by for loop. d. Create a table employees. Insert 5 meaning full records in it. With the help of cursor loop display the employee id from the given table. e. Create a table employee. Create a table Job with emp_no and Job_title. Insert 5 meaning full records in both tables. Write a Cursor for loop with FROM clause of the SELECT statement which contains a subqueries that select the total number of employee enroll in each department. f. Create a table employee. Insert 5 meaning full records in it. Use pl/sql, cursor and for loop to count no of records in the given table. g. Create a table employee. Insert 5 meaning full records in it. Create a parameterized cursor to find given employee in the table. h. Write a program to define cursor variable of type strongly and weakly. 4. Study of transactions and locks
a.

a. Create a table Ticket. Insert 5 meaningful records in it. Perform the action of booking ticket. Either Commit transaction or roll the whole transaction b. Create a table Employee and customer. Insert 5 meaningful records in both tables. Perofm following operations on tables by single transaction query. Committee Employee transaction and rollback Customer transaction. (Partial Rollback) i. Update Employee by increasing salary of all employees by 5000. Increase Bonus by 1000 for specified employee. ii. Update Customer by increasing purchase by 5000 for a specified customer id. c. Create Employee and position table. Simultaneously access Employee and position in updated mode on two separate windows and ask access of other table to experience a deadlock. d. Create tables and resolve deadlock by setting Lock timeout

You might also like