SQL Questions Sample 2020
SQL Questions Sample 2020
12 BEGIN
DBMS_OUTPUT.PUT_LINE('TRUE');
END;
/
13 BEGIN
DBMS_OUTPUT.PUT_LINE('My First Program');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error');
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Error');
END;
/
36 DECLARE
l_count NUMBER;
BEGIN
SELECT count(1) into l_count FROM EMP WHERE 1=1;
DBMS_OUTPUT.PUT_LINE(l_count);
END;
/
37 SET SERVEROUTPUT on;
DECLARE
CURSOR emp_cur
IS SELECT * FROM EMP;
emp_rec emp%ROWTYPE;
BEGIN
OPEN emp_cur;
LOOP
FETCH emp_cur INTO emp_rec;
DBMS_OUTPUT.PUT_LINE(emp_rec.empno);
END LOOP;
CLOSE emp_cur;
END;
/
38 DECLARE
CURSOR emp_cur
IS SELECT * FROM EMP;
emp_rec emp%ROWTYPE;
BEGIN
OPEN emp_cur;
LOOP
FETCH emp_cur INTO emp_rec;
DBMS_OUTPUT.PUT_LINE(emp_rec.empno);
EXIT WHEN emp_cur%NOTFOUND;
END LOOP;
CLOSE emp_cur;
END;
/
39 BEGIN
UPDATE EMP
SET SAl=SAL*10
WHERE 734=734
;
DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT);
END;
/
40 SET SERVEROUTPUT on;
DECLARE
l_number NUMBER;
BEGIN
l_number:='Hello';
DBMS_OUTPUT.PUT_LINE(l_number);
END;
/
41 DECLARE
l_number NUMBER:=2;
BEGIN
l_number:=3;
DBMS_OUTPUT.PUT_LINE(l_number);
END;
/
l_number:=3;
END;
DBMS_OUTPUT.PUT_LINE(l_number);
END;
/
l_number:=3;
END;
DBMS_OUTPUT.PUT_LINE(l_number);
END;
/
31-Dec-1899 0
Predefined Exception Internal Exception User defined Exceptio None of the above
SQL CREATE PROCEDUSQL CREATE FUNCTION Both A & B None of the above
2-Jan-1900 2 4 5
Implicit cursors are Developers should use imImplicit cursors are us Implicit cursors are no longer a feature in Oracle
Record type declarati Opening and parsing of Fetches records from cRequires exit condition to be defined
Use employeE.lname Use employeE.lname%rLook up datatype for Declare it to be type LONG
It causes the cursor toIt causes the cursor to It loads the current ro It creates the variables to hold the current row values
The name of a variablA literal value An expression All of the above None of the above
OUT IN CONSTANT
IN OUT IN OUT All the three
Formal and actual pa Formal and actual paramA formal parameter is An actual parameter is declared within the called proc
Total records count inZero records displayed One record displayes Infinate loop
2 3 5 Null
2 3 5 0
2 3 5 0
PL SQL High
PL SQL High
PL SQL Medium
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Medium
PL SQL Simple
PL SQL High
PL SQL Medium
PL SQL Medium
PL SQL Simple
PL SQL Medium
PL SQL Medium
s declared within the called proc PL SQL Medium
PL SQL Medium
PL SQL Medium
PL SQL High
PL SQL High
PL SQL Medium
PL SQL High
PL SQL Simple
PL SQL Medium
PL SQL Medium
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
PL SQL Simple
CATEGORY