Set 2
Set 2
2. You need to create a view EMP_VU . The view should allow the users to manipulate the records of
only the employees
that are working for departments 10 or 20. write a sql statement would you use to create the view
EMP_VU?
you need to create a report of the 10 students who achieved the highest ranking in the course
INTSQL and who completed the course
in the year 1999. write a sql query to accomplish this task?
SET 2 : 1 Hour
SET SERVEROUTPUT ON
DECLARE
v_result VARCHAR2(5):='SAMPLE';
BEGIN
dbms_output.put_line(v_result);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('some error occured while processing.');
END;
/
what will be the output?
DEPTNO SAL
10 1000
20 2000
30 1500
20 400
10 500
30 700
DEPTNO SAL
1 1500
2 2400
3 2200
7. How to insert '03-may-11 21:02:44' date into the column "last_date" of table "ABC".
SET 2 : 1 Hour
DECLARE
BEGIN
FOR i IN 1..10 LOOP
DECLARE
my_execp EXCEPTION;
BEGIN
IF(I = 5) THEN
RAISE my_execp;
ELSE
DBMS_OUTPUT.PUT_LINE('updated');
END IF;
EXCEPTION
WHEN my_execp THEN
dbms_output.put_line('not-update');
END;
END LOOP;
END;