1) select e.ename , e.deptno , e.sal from emp e , emp d where e.deptno = d.deptno and d.ename like '%T%'; / 2) select e.ename , e.empno from emp e , emp d where e.deptno =d.deptno and d.ename like '%T%' and e.sal > (select avg(sal) from emp ) / 3) select e.ename , e.deptno , e.sal from emp e , emp d where e.deptno= d.deptno and e.sal = d. sal and e.comm is not null; / 4) select e.ename , e.deptno , e.sal from emp e , emp d , dept k where e.sal = d.sal and e.comm = d.comm and d.deptno = k.deptno and k.loc ='DALLAS' / 5) variable deis1 number; accept deis1 prompt 'Enter the employeno'; declare deis1 emp.empno%type; begin if (select sal from emp where empno =:deis1 ) < 1000 then update table emp set comm = sal * 1.1; end if if (select sal from emp where empno =:deis1 ) < 1500 then update table emp set comm = sal * 1.15; end if if (select sal from emp where empno =:deis1 ) > 2000 then update table emp set comm = sal * 1.2; end if if (select sal from emp where empno =:deis1 ) is null then update table emp set comm = 0; end if end; / 6) declare type dept_table_type is table of dept.deptno%type index by binary_integer; my_dept_table dept_table_type; begin for i in 1..4 loop insert into my_dept_table select deptno,dname,loc from dept where deptno = 10*i; end loop; for i in 1..4 loop select * from my_dept_table where deptno = 10*i; end loop; end; / 7) 8) create table messages (mesg varchar2); variable deis1 varchar2; accept deis1 prompt 'Enter the salary'; declare deis1 emp.sal%type; begin insert into message select ename from emp where sal = :deis1; exception when no_data_found then insert into message(mesg) value('no data found'); when too_many_rows then insert into message(mesg) value('too many rows'); end; / Question1) create or replace package chk_pack Question2) create or replace trigger sad_insb before insert or delete on emp begin DBMS_OUTPUT.PUT_LINE('Insertion will occur'); end; create or replace trigger sad_insa after insert or delete on emp begin DBMS_OUTPUT.PUT_LINE('Insertion is complete'); end; create or replace trigger sad_up before update on emp begin DBMS_OUTPUT.PUT_LINE('Update complete'); end; /