This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ASSIGNMENT I 16 th June 2005 Submission Date:18 th june 2005 before 10.30 a.m Mode of submission: Soft Copy submission dt-25th june 1. Write a PL/SQL code to update salary of employee number 7789 to 3000 if salary is less than 3000 begin Update emp set sal=300 where sal<3000 and (empno>=3000 and empno<=7789); end; 2. Write a pl/sql code to insert all the details of employee no: 7698 to a new table temp which has the same structure as the emp table. set serveroutput on Declare Rec emp%rowtype; Begin select * into rec from emp where empno=7698; dbms_output.put_line(rec.ename); end; 3. Write a pl/sql code to print first 50 whole numbers. Also insert the list in temp table. Temp table contains only one column of number datatype Declare I number; Begin Create table temp (num number); For I in 1..50 loop Insert into temp values (i) ; End loop; end; 4. Update the commission of the employee number 7369 to Rs. 300 if it is NULL; else raise his commission by 25%; set serveroutput on DECLARE num emp.comm%type; cursor c is select comm from emp where empno=7369 and comm is not null; BEGIN open c;...
View Full Document
- Summer '10