SQL and PL SQL
SQL and PL SQL
3. Declare
fvar number := null; svar number := 5
Begin
goto << fproc>>
if fvar is null then
<< fproc>>
svar := svar + 5
end if;
End;
What will be the value of svar after the execution ?
a] Error
b] 10
c] 5
d] None of the above
4. Declare
a number := 5; b number := null; c number := 10;
Begin
if a > b AND a < c then
a := c * a;
end if;
End;
What will be the value of 'a' after execution ?
a] 50
b] NULL
c] 5
d] None of the above
a] ALWAY
b} S ALWA
c] ALWAYS
6. REPLACE('JACK AND JUE','J','BL') will return
13. Assuming the date and time is 09/09/2009 09:09:09, what value will the
following statement return SELECT
TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH24:MI:SS')
FROM dual;
A. 09/09/2009 09:09:09
B. 09/09/2009 09:09:09AM
C. 09/09/2009
D. 09/09/2009 00:00:00
E. None of the above
14. The || is is an example of what function
SELECT last_name || ', ' || first_name || ' ' || middle_name
FROM employees;
A. Incantination
B. Integration
C. Continuation
D. Concatenation
E. None of the above
17. Select the best answer below. What are the components of a package?
A. Box, wrapping and binding
B. Header and body
C. Specification and content
D. Specification and body
E. None of the above
18. . What is the correct syntax to create procedure MYPROC that accepts two
number parameters X and Y?
a.CREATE PROCEDURE myproc (x NUMBER, y NUMBER) IS ...
b.CREATE PROCEDURE (x NUMBER, y NUMBER) myproc IS ...
c.CREATE PROCEDURE myproc IS (x NUMBER, y NUMBER) ...
d.CREATE PROCEDURE IS myproc (x NUMBER, y NUMBER) ...
19. You want all dates when any employee was hired. Multiple employees were
hired on the same date and you want to see the date only once.
Query - 1
Select distinct hiredate
From hr.employee
Order by hiredate;
Query - 2
Select hiredate
From hr.employees
Group by hiredate
Order by hiredate;
Which of the above query is valid?
A) Query - 1
B) Query - 2
C) Both
20. Select the best answer. Which listed attribute is an invalid attribute of an
Explicit cursor.
A. %NOTFOUND
B. %FOUND
C. %ROWCOUNT
D. %ISOPEN
E. None of the above. All of these are valid.
A. SELECT CALC_PLAYER_AVG(PLAYER_ID)
FROM PLAYER_BAT_STAT;
B. EXECUTE CALC_PLAYER_AVG(31);
C. CALC_PLAYER(‘RUTH’);
D. CALC_PLAYER_AVG(31);
E. START CALC_PLAYER_AVG(31);
23. Which two programming constructs can be grouped within a package? (Choose two)
A. Cursor
B. Constant
C. Trigger
D. Sequence
E. View
24. Which code can you use to ensure that the salary is not increased by more than 10% at a
time nor is it
ever decreased?
ANSWER --22