Professional Documents
Culture Documents
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