SQL Basics
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDatabasesSQL Basics

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 20th, 2008, 04:27 PM
aatishpatel aatishpatel is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 aatishpatel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 49 sec
Reputation Power: 0
Can anyone answer these questions?

1. An Exit statement can only be used inside a PL/SQL loop. (Points: 14)
True
False


2. What is true about the following PL/SQL block.
DECLARE
i NUMBER := 1;
BEGIN
LOOP
dbms_output.put_line (i);
i := i+1;
END LOOP;
END;
(Points: 14)
An infinite loop.
Will continue printing numbers beginning with 1 until the buffer overflow limit is reached.
both 1 and 2 are correct.
Will give syntax error.


3. How many times is a While loop executed if the test condition always evaluates to FALSE? (Points: 14)
Infinte
Will never execute
Will give runtime error
Will give syntax error


4.
What is the value of a FOR loop counter after the termination of the loop?
(Points: 14)
same as lower limit
same as upper limit
Undefined
0 (zero)


5. An inner loop can use a variable declared in the outer loop but the outer loop can not use variable declared in the inner loop. (Points: 14)
True
False


6. What types of PL/SQL loops can be nested one inside another? (Points: 14)
A simple loop inside a WHILE loop.
A WHILE loop inside a simple loop.
Any loop can be nested inside another loop.
None of the above.


7. An implicit cursor is automatically associated (generated) with every DML statement. (Points: 14)
True
False


8. Main advantage of using an explicit cursor is that it allows you to process rows returned by SELECT statement, one row a a time. (Points: 14)
True
False


9. The following PL/SQL block, when excuted will display,
DECLARE
CURSOR csr_ac (p_name VARCHAR2) IS
SELECT empno, name, sal
FROM emp
WHERE name LIKE '%p_name%';
BEGIN
FOR rec_ac IN csr_ac ('LE')
LOOP
DBMS_OUTPUT.PUT_LINE(rec_ac.empno || ' ' ||rec_ac.name || ' '||v_sal);
END LOOP ;
CLOSE csr_ac;
END;
/

(Points: 14)
employee number, name and salary of all emplyees.
employee number, name and salary of all emplyees whose name contains string, 'LE' .
will not display anything.


10. Once all of the rows in the cursor have been processed (retreived), the cursor should be closed. Otherwise, it will generate syntax error. (Points: 14)
True
False


11. A PL/SQL procedure can be created and stored in the database without execution of the code. (Points: 14)
True
False


12. PL/SQL functions returns a scalar value and PL/SQL procedures return nothing. Both can take zero or more number of parameters as input or output. (Points: 14)
True
False


13. In a PL/SQL procedure, parameter modes for formal parameters are (Points: 14)
IN
OUT
IN OUT
All of the above


14. What are the methods for passing parameters in PL/SQL procedures. (Points: 14)
Positional
Named
Combination of positional and Named.
all of the above


15. A PL/SQL function can be called as part of a SQL expression or as part of a PL/SQL expression.

(Points: 14)
True
False


16. In PL/SQL function, multiple RETURN statements are allowed, usually within an IF statement. Only one RETURN statement will be executed. (Points: 14)
True
False


17. The parameters of a function must be labeled IN or the function will not complete successfully. (Points: 14)
True
False


18. IN OUT paramenters are permissible in PL/SQL functions. (Points: 14)
True
False


19. PL/SQL package groups logically related program units like procedures and function. (Points: 14)
True
False


20. Advantage(s) of PL/SQL packages is(are) (Points: 14)
Modularity
Easier application design
Better performance
all of the above


21. All procedures and functions in a package body must be declared in the package specification. (Points: 14)
True
False


22. A trigger is a PL/SQL block that executes implicitly whenever a particular event takes place. (Points: 14)
True
False


23. emp table has the following trigger on it.
CREATE OR REPLACE TRIGGER secure_emp
Before INSERT ON emp
Begin
IF (TO_CHAR (sysdate,'DY') IN ('SAT','SUN'))
OR (TO_CHAR (sysdate, 'HH24') NOT BETWEEN '08' AND '18') THEN
RAISE_APPLICATION_ERROR (-20500, 'System not available. Please try later');
END IF;
END;

It will restrict any user accessing emp table from
(Points: 14)
inserting any data into emp table
updating any data in emp table
deleting any row from emp table.
inserting any row into emp table outside regular business hours of 8 a.m to 6 p.m. Monday through Friday.


24. A trigger can fire for which of the following? (Points: 14)
Before a triggering event.
after a triggering event
before or after the triggering event.


25. A BEFORE INSERT trigger fires for which of the following? (Points: 14)
Before an update is issued against the triggering table
After an INSERT is issued against the triggering table
Before an INSERT is issued against the triggering table
all of the above






your help is really appreciated

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSQL Basics > Can anyone answer these questions?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT