- Which of the following statements is true about implicit cursors?
- Implicit cursors are used for SQL statements that are not named.
- Developers should use implicit cursors with great care.
- Implicit cursors are used in cursor for loops to handle data processing.
- Implicit cursors are no longer a feature in Oracle.
- Which of the following is not a feature of a cursor FOR loop?
- Record type declaration.
- Opening and parsing of SQL statements.
- Fetches records from cursor.
- Requires exit condition to be defined.
- A developer would like to use referential datatype declaration on a variable. The variable name is EMPLOYEE_LASTNAME, and the corresponding table and column is EMPLOYEE, and LNAME, respectively. How would the developer define this variable using referential datatypes?
- Use employee.lname%type.
- Use employee.lname%rowtype.
- Look up datatype for EMPLOYEE column on LASTNAME table and use that.
- Declare it to be type LONG.
- Which three of the following are implicit cursor attributes?
- %found
- %too_many_rows
- %notfound
- %rowcount
- %rowtype
- If left out, which of the following would cause an infinite loop to occur in a simple loop?
- LOOP
- END LOOP
- IF-THEN
- EXIT
- Which line in the following statement will produce an error?
- cursor action_cursor is
- select name, rate, action
- into action_record
- from action_table;
- There are no errors in this statement.
- The command used to open a CURSOR FOR loop is
- open
- fetch
- parse
- None, cursor for loops handle cursor opening implicitly.
- What happens when rows are found using a FETCH statement
- It causes the cursor to close
- It causes the cursor to open
- It loads the current row values into variables
- It creates the variables to hold the current row values
- Read the following code:
CREATE OR REPLACE PROCEDURE find_cpt (v_movie_id {Argument Mode} NUMBER, v_cost_per_ticket {argument mode} NUMBER) IS BEGIN IF v_cost_per_ticket > 8.5 THEN SELECT cost_per_ticket INTO v_cost_per_ticket FROM gross_receipt WHERE movie_id = v_movie_id; END IF; END;Which mode should be used for V_COST_PER_TICKET?
- IN
- OUT
- RETURN
- IN OUT
- Read the following code:
CREATE OR REPLACE TRIGGER update_show_gross {trigger information} BEGIN {additional code} END;The trigger code should only execute when the column, COST_PER_TICKET, is greater than $3. Which trigger information will you add?
- WHEN (new.cost_per_ticket > 3.75)
- WHEN (:new.cost_per_ticket > 3.75
- WHERE (new.cost_per_ticket > 3.75)
- WHERE (:new.cost_per_ticket > 3.75)
- What is the maximum number of handlers processed before the PL/SQL block is exited when an exception occurs?
- Only one
- All that apply
- All referenced
- None
- For which trigger timing can you reference the NEW and OLD qualifiers?
- Statement and Row
- Statement only
- Row only
- Oracle Forms trigger
- Read the following code:
CREATE OR REPLACE FUNCTION get_budget(v_studio_id IN NUMBER) RETURN number IS v_yearly_budget NUMBER; BEGIN SELECT yearly_budget INTO v_yearly_budget FROM studio WHERE id = v_studio_id; RETURN v_yearly_budget; END;Which set of statements will successfully invoke this function within SQL*Plus?
- VARIABLE g_yearly_budget NUMBER
EXECUTE g_yearly_budget := GET_BUDGET(11); - VARIABLE g_yearly_budget NUMBER
EXECUTE :g_yearly_budget := GET_BUDGET(11); - VARIABLE :g_yearly_budget NUMBER
EXECUTE :g_yearly_budget := GET_BUDGET(11); - VARIABLE g_yearly_budget NUMBER
:g_yearly_budget := GET_BUDGET(11);
- VARIABLE g_yearly_budget NUMBER
-
CREATE OR REPLACE PROCEDURE update_theater (v_name IN VARCHAR v_theater_id IN NUMBER) IS BEGIN UPDATE theater SET name = v_name WHERE id = v_theater_id; END update_theater;When invoking this procedure, you encounter the error:
ORA-000: Unique constraint(SCOTT.THEATER_NAME_UK) violated.
How should you modify the function to handle this error?
- An user defined exception must be declared and associated with the error code and handled in the EXCEPTION section.
- Handle the error in EXCEPTION section by referencing the error code directly.
- Handle the error in the EXCEPTION section by referencing the UNIQUE_ERROR predefined exception.
- Check for success by checking the value of SQL%FOUND immediately after the UPDATE statement.
- Read the following code:
CREATE OR REPLACE PROCEDURE calculate_budget IS v_budget studio.yearly_budget%TYPE; BEGIN v_budget := get_budget(11); IF v_budget < 30000 THEN set_budget(11,30000000); END IF; END;You are about to add an argument to CALCULATE_BUDGET. What effect will this have?
- The GET_BUDGET function will be marked invalid and must be recompiled before the next execution.
- The SET_BUDGET function will be marked invalid and must be recompiled before the next execution.
- Only the CALCULATE_BUDGET procedure needs to be recompiled.
- All three procedures are marked invalid and must be recompiled.
- Which procedure can be used to create a customized error message?
- RAISE_ERROR
- SQLERRM
- RAISE_APPLICATION_ERROR
- RAISE_SERVER_ERROR
- The CHECK_THEATER trigger of the THEATER table has been disabled. Which command can you issue to enable this trigger?
- ALTER TRIGGER check_theater ENABLE;
- ENABLE TRIGGER check_theater;
- ALTER TABLE check_theater ENABLE check_theater;
- ENABLE check_theater;
- Examine this database trigger
CREATE OR REPLACE TRIGGER prevent_gross_modification {additional trigger information} BEGIN IF TO_CHAR(sysdate, DY) = MON THEN RAISE_APPLICATION_ERROR(-20000,Gross receipts cannot be deleted on Monday); END IF; END;This trigger must fire before each DELETE of the GROSS_RECEIPT table. It should fire only once for the entire DELETE statement. What additional information must you add?
- BEFORE DELETE ON gross_receipt
- AFTER DELETE ON gross_receipt
- BEFORE (gross_receipt DELETE)
- FOR EACH ROW DELETED FROM gross_receipt
- Examine this function:
CREATE OR REPLACE FUNCTION set_budget (v_studio_id IN NUMBER, v_new_budget IN NUMBER) IS BEGIN UPDATE studio SET yearly_budget = v_new_budget WHERE id = v_studio_id; IF SQL%FOUND THEN RETURN TRUEl; ELSE RETURN FALSE; END IF; COMMIT; END;Which code must be added to successfully compile this function?
- Add RETURN right before the IS keyword.
- Add RETURN number right before the IS keyword.
- Add RETURN boolean right after the IS keyword.
- Add RETURN boolean right before the IS keyword.
- Under which circumstance must you recompile the package body after recompiling the package specification?
- Altering the argument list of one of the package constructs
- Any change made to one of the package constructs
- Any SQL statement change made to one of the package constructs
- Removing a local variable from the DECLARE section of one of the package constructs
- Procedure and Functions are explicitly executed. This is different from a database trigger. When is a database trigger executed?
- When the transaction is committed
- During the data manipulation statement
- When an Oracle supplied package references the trigger
- During a data manipulation statement and when the transaction is committed
- Which Oracle supplied package can you use to output values and messages from database triggers, stored procedures and functions within SQL*Plus?
- DBMS_DISPLAY
- DBMS_OUTPUT
- DBMS_LIST
- DBMS_DESCRIBE
- What occurs if a procedure or function terminates with failure without being handled?
- Any DML statements issued by the construct are still pending and can be committed or rolled back.
- Any DML statements issued by the construct are committed
- Unless a GOTO statement is used to continue processing within the BEGIN section, the construct terminates.
- The construct rolls back any DML statements issued and returns the unhandled exception to the calling environment.
- Examine this code
BEGIN theater_pck.v_total_seats_sold_overall := theater_pck.get_total_for_year; END;For this code to be successful, what must be true?
- Both the V_TOTAL_SEATS_SOLD_OVERALL variable and the GET_TOTAL_FOR_YEAR function must exist only in the body of the THEATER_PCK package.
- Only the GET_TOTAL_FOR_YEAR variable must exist in the specification of the THEATER_PCK package.
- Only the V_TOTAL_SEATS_SOLD_OVERALL variable must exist in the specification of the THEATER_PCK package.
- Both the V_TOTAL_SEATS_SOLD_OVERALL variable and the GET_TOTAL_FOR_YEAR function must exist in the specification of the THEATER_PCK package.
- A stored function must return a value based on conditions that are determined at runtime. Therefore, the SELECT statement cannot be hard-coded and must be created dynamically when the function is executed. Which Oracle supplied package will enable this feature?
- DBMS_DDL
- DBMS_DML
- DBMS_SYN
- DBMS_SQL
-
Job Interview Question Articles
- C# Interview Questions and Answers
- QTP Interview Questions and Answers
- C++ Interview Questions and Answers
- PHP Interview Questions and Answers
- XML Interview Questions and Answers
- JavaScript Interview Questions and Answers
- Asp.Net Interview Questions and Answers
- J2EE Interview Questions and Answers
- ABAP Interview Questions and Answers
- Perl Interview Questions and Answers
- Java Interview Questions and Answers
-
Resources
- Technology Question and Answer Website
- How to dance around the salary-expectation question
- 10 mistakes managers make during job interviews
- ID Maker
- Stupid interview questions
- How to Answer These Tricky Interview Questions
- Seven tips for writing an online profile for LinkedIn, MySpace or Facebook
- Video surveillance
- Ink cartridges
- Laptop computers
- Affordable life insurance
- Ink cartridges
-
Tutorials
-
RSS Feeds

50 Comments on PL/SQL interview qiuestions
Thanks again for publishing my questions.
1.1
2.2
3.1
4.(1,3,4)
5.2
6.3
7.4
8.2
9.2
10.(3,4)
11.1
12.4
13.1
14.1
15.3
16.3
17.1
18.(1,4)
19.4
20.3
21.4
22.2
23.4
24.3
25.4
please let me know how many answers are right. in this pl/sql test.
Thanks & Regards,
Sudhir Rao.
Answer to question-2 is 4
24 IS 4
The answer to the question 8 is wrong; should be 3.
Answer to number 9 should be 4.
How can you check for the initial value, if there is no user input?
The Answer to the question 8 is 3rd Choice.
Question 13 all the four answers are wrong , the function executed like this
SQL> select get_budget(11) into :g_yearly_budget from dual;
GET_BUDGET(11)
————–
Let me know, if you have any Suggestions.
The Answer to the question 5 is 4rd Choice.
If you are missing the END LOOP (2), the loop do not work, procedure does not compile.
The Answer to the question 5 is 1rd Choice.
Iti’s imposible that both 3 and 4 are correct. We do not need location (where) we need time (when).
The Answer to the question 5 is 3rd Choice.
The 4rd (Oracle Forms trigger) is in some way correct, but oracle triggers and Forms triggers are not the same. This question is about Oracle triggers (not Forms).
Hi Ahamed Tharik.N your answer is correct, but also answer number 2 works to be able to see the result uses SQL>print g_yearly_budget.
The answer to the question 13 should be 2.
I fully agree with Francisco J. Banda. For Francisco, your answers are right, just match question numbers.
I tried to do and here is the revised answer list. (T means correct answer choice)
1.)1 : T
2.)2 - 4 : 4 - T
3.)1 : T
4.)(1,3,4) - T
5.)2 - 4 : 4 - T
6.)3 - T
7.)4 - T
8.)2 - 3 - 3 : 3 - T
9.)2 - 4 : 4 - T
10.)(3,4) - 1
11.)1 - [I dont know correct answer]
12.)4 - 3 : 3 - T
13.)1 - ? : 2 - T
Thanks.
1.1
2.4
3.2
4.1,3,5
5.2
6.2,3
7.1
8.3
9.4
10.4
11.4
12.1
13.2
14.4
15.3
16.2
17.2
18.1
19.4
20.3
21.4
22.2
23.4
24.4
25.4
The answer to the 23 is 4
answer for 22 is 2
answer for 18 is 1
Right answer to QUS.5 is 4th option coz if end loop is missed in programming it wud through error while compiling , but if u missed EXIT , the program wud not know where to exit the loop …and loop wud go on
1. 1
2. 4
3. 1
4. 1,3,4
5. 2
6. 2,3
7. 4
8. 3
9. 4
10. 1
11. 2
12. 3
13. 2
14.4
15. 3
16. 3
17.2
18. 1
19. 3
20.3
21. 4
22. 2
This is what I think the answers should be:
1.1
2.4
3.1
4.1,3,4
5.4
6.3
7.4
8.3
9.4
10.1
11. Not certain but if I have to pick, I would pick 1
12.3
13.2
14.2 (In When Others clause of Exception Handler, we can trap the SQLCODE and display user friendly message.)
15.3
16.3
17.1
18.1
19.4
20.1 (Both the package spec and the package body must be compiled only when the global function definition changes)
21.2
22.2
23.4
24.4
25.4
Goodluck!!
The Correct answers are:
1: 1
2: 4
3: 1
4: 1 3 4
5: 4
6: 3
7: 4
8: 3
9: 4
10: 1
11: 1
12: 3
13: 2
14: 2
15: 3
16: 3
17: 1
18: 1 2
19 None Of Them
20: 2
21: 2
22: 2
23: 4
24: 4
25: 4
Think all my answers are correct
1. 1
2. 4
3. 1
4. (1,3,5)
5. 4
6. 3
7. 4
8. 3
9. 4
10. 1
11. 1
12. 3
13. 2
14. 1 (I’m sure this is correct but may be 4 can also)
15. 3
16. 3
17. 1
18. 1
19. 4
20. 3
21. 4
22. 2
23. 4
24. 4
25. 4
can somebody explain 20th question:i feel that all the 4 answers are correct and for 21st question i feel that 2 and 3 are correct answers.Please support your ans by some examples,so that it can be understood by one and all.Thanks in advance.
These are Correct answers:
1 - 1
2 - 4
3 - 1
4 - 1,3,4
5 - 4
6 - 3
7 - 4
8 - 3
9 - 4
10 - 1
11 - 1
12 - 3
13 - 2
14 - 1
15 - 3
16 - 3
17 - 1
18 - 1
19 - 4
20 - 1
21 - 2
22 - 2
23 - 4
24 - 4
25 - 4
1.1
2.4
3.1
4.1,3,4
5.1
6.3
7.4
8.3
9.4
10.1
11.2
12.3
13.4
16.3
17.1
18.1
I get:
1) 1,2 [2 must be true - anything should be handled with great care :)]
2)1,2
3)1
4)1,3,4
5)4
6)3
7)4
8)3
9)1
10)4
11)1
12)3
13)4
14)1
15)3
16)3
17)1
18)1
19)4
20)1,2
21)4
22)2
23)4
24)4
25)4
Why do most people feel that you need to delcare a record type for a cursor for loop as in q 2? I have NEVER created a record type for a cursor for loop. I think such a basic question not being answered correctly is strange.
number 1 and number 4 are both correct.
Good job Potkin Namat, you’re the million dollar winner because you didn’t listen to the masses.
Well I guess the answers are :
1 -1
2- 1
3- 1
4- 1,3,4
5- 4
6- 3
7- 4
8- 3
9- 2
10- 4
11- 1
12- 3
13- 2
14- 1
15- 3
16- 3
17- 1
18- 1
19- 4
20- 1
21- 2
22- 2
23- 4
24- 4
25- 4
1)3
2)4
3)1
4)1,3,4
5)2
6)3
7)4
8)3
9)4
10)2
11)1
12)3
13)2
14)1
15)4
16)3
17)1
18)1
19)4
20)2
21)2
22)2
23)4
24)4
25)4
THIS IS TILAK OK
I think these r the right answers
1)1
2)1
3)1
4)1,3,4
5)4
6)3
7)4
8)3
9)4
10)2
11)1
12)1
13)2
14)3
15)3
16)3
17)1
18)1
19)4
20)1
21)4
22)2
23)4
24)4
25)4
My Answers are:-
1.1,2
3.1
4.1,3,4
5.4
6.3
7.4
8.3
9.4
10.1
11.1
12.3
13.2
15.3
16.3
17.3
18.1
19.4
21.2
22.2
23.4
25.4
Tell me how many answers are right.
This is my first try.
1)3
2)4
3)1
4)3,4,5
5)4
6)3
7)1
8)4
9)2
10)4
11)2
12)3
13)1
14)1
15)3
16)2
17)2
18)4
19)3
20)4
21)2
22)2
23)4
24)4
25)4
1-1
2- 1
3- 1
4- 1
5- 4
6- 3
7- 4
8- 3
9- 2
10- 4
11- 1
12- 3
13- 2
14- 1
15- 3
16- 3
17- 1
18- 1
19- 4
20- 1
21- 2
22- 2
23- 4
24- 4
25- 4
Hi guys,
I gave this test, and would like to know how much I score. Ofcourse, everyone has posted what they think are the “right” answers…but, do we have some expert here, who can be nice enough to compile a list of the correct answers to all questions?! Here are my answers, I am not syaing they right, so kindly DO NOT use to check. I only want to know my score.
Thanks in advance!
Arvinda.
1-1
2-4
3-1
4-1,2,3
5-4
6-3
7-4
8-3
9-4
10-2
11-1
12-3
13-4
14-1
15-3
16-3
17-1
18-1
19-4
20-2
21-2
22-2
23-4
24-4
25-4
Hi frnds, ths johnny….
Hre’s d key 4 d ??? stated –> ^
1.1
2.1
3.1
4.1,3,4
5.4
6.3
7.4
8.3
9.4
10.1
11.1
12.3
13.2
14.1
15.3
16.3
17.1
18.1
19.4
20.1
21.2
22.2
23.4
24.4
25.4
1-1
2- 4
3- 1
4- 1,3,4
5- 4
6- 3
7- 4
8- 3
9- 4
10- 1
11- 1
12- 3
13- 2
14- 1
15- 3
16- 3
17- 1
18- 1
19- 4
20- 2
21- 2
22- 2
23- 4
24- 4
25- 4
1-1
2- 4
3- 1
4- 1,3,4
5- 4
6- 3
7- 4
8- 3
9- 4
10- 1
11- 1
12- 3
13- 2
14- 1
15- 3
16- 3
17- 1
18- 1
19- 4
20- 2
21- 2
22- 2
23- 4
24- 4
25- 4
Hi,
I think the answer should be :
1-1
2- 4
3- 1
4- 3,4,5
5- 4
6- 3
7- 4
8- 3
9- 4
10- 1
11- 1
12- 3
13- 2
14- 1
15- 3
16- 3
17- 1
18- 1
19- 4
20- 2
21- 2
22- 2
23- 4
24- 4
25- 4
In the above implicit cursor attributes are only to_many_rows
1)1
2)4
3)1
4)2,3,4
5)
6)3
7)4
8)3
9)4
10)2
11)1
12)3
13)4
14)3
15)3
16)3
17)2
18)1
19)4
20)
21)4
22)2
23)4
24)4
25)4
1)1
2)4
3)1
4)1,3,4
5)4
6)3
7)4
8)3
9)4
10)1
11)1
12)3
13)2
14)3
15)3
16)3
17)1
18)1
19)4
20)1
21)4
22)2
23)4
24)4
25)4
Hi
These are my ans’s can u plz tell me my score how many r right & wrong
qtn ans
1 1
2 1
3 3
4 1,3,4
5 4
6 3
7 4
8 3
9 4
10 4
11 1
12 3
13 2
14 1
15 3
16 3
17 3
18 1
19 3
20 2
21 2
22 2
23 4
24 4
25 4
hi here is my answer could you tell how many answers are correct. Thank you.
1. 1
2. 4
3. 1
4. 1 , 3 , 4
5. 4
6. 3
7. 4
8. 3
9. 4
10. 1
11. 1
12. 3
13. 2
14. 3
15. 1
16. 3
17. 1
18. 1
19. 3
20. 2
21. 2
22. 2
23. 1
24. 4
25. 4
1. 1
2. 4
3. 1
4. 1,3,4
5. 4
6. 3
7. 4
8. 3
9. 4
10. 1
11. 1 only one for which exception is raised
12. 3
13. 2
14. 1 befor updating check whether data exist and if yes then handle in exception with user defined exception else update the data.
15. all the procedures / packages depend on altered procedure / package needs to be compiled again.
16. 3
17. 1
18. 1
19. 4
20. If any of the change is made either in spec or body , we need to compile both spec and body of package and all the depending packages.
21. 3
22. 2
23. 4
24. 4
25. 4
1 1
2 2
3 1
4 1 3 4
5 4
6 5
7 4
8 3
9 4*
10 1
11 1
12 3
13 4
14 1*
15 3
16 2
17 1*
18 1
19 1
20 1234*
21 2
22 2
23 4
24 4
25 4
My answers are:
1) 1;
2) 2;
3) 1;
4) 1,3,4;
5) 2;
6) 3;
7) 4;
8) 3;
9) 4;
10)2;
11)4;
12)3;
13)1;
14)1;
15)1;
16)3;
17)3;
18)1;
19)2;
20)1,4;
21)2;
22)2;
23)4;
24)4;
25)1.
Hii
If any expert can go through my answers and tell my result then i would bbe thankful to him.
My Answers
———
1. 1
2. 1
3. 2
4. 1,3,4
5. 3
6. 3
7. 4
8. 3
9. 4
10. 1
11. 2
12. 3
13. 2
14. 2
15. 3
16. 3
17. 3
18. 4
19. 4
20. 2
21. 2
22. 2
23. 4
24. 4
25. 1
1)3
2)4
3)1
4)1,3,4
5)2
6)3
7)4
8)3
9)4
10)2
11)1
12)3
13)2
14)1
15)4
16)3
17)1
18)1
19)4
20)2
21)2
22)2
23)4
24)4
25)4
1. 1
2. 1
3. 1
4. 1,3,4
5. 4
6. 3
7. 4
8. 4
9. 1
10. 2
11. 1
12. 3
13. 2
14. 1
15. 1
16. 2
17. 3
18. 4
19. 1
20. 4
21. 3
22. 2
23. 4
24. 4
25. 1
I meant to say (spaces not tabs!)
1)* 3 1 1 1,2 1 1
2)* 4 4 1 1,2 4 4
3)* 1 1 1 1 1 2
4)* 1,3,4 1,3,4 1,3,4 1,3,4 (1,3,5) 1,3,5
5)* 2 4 4 4 4 2
6)* 3 3 3 3 3 2,3
7)* 4 4 4 4 4 1
8) 3 3 3 3 3 3
9)** 4 4 2 1 4 4
10)** 2 1 4 4 1 4
11)* 1 1 1 1 1 4
12)* 3 3 3 3 3 1
13) 2 2 2 4 2 2
14)* 1 1 1 1 1 4
15)* 4 3 3 3 3 3
16)* 3 3 3 3 3 2
17) 1 1 1 1 1 2
18) 1 1 1 1 1 1
19) 4 4 4 4 4 4
20)* 2 2 1 1,2 3 3
21)* 2 2 2 4 4 4
22) 2 2 2 2 2 2
23) 4 4 4 4 4 4
24) 4 4 4 4 4 4
25) 4 4 4 4 4 4