Company: Oracle India Pvt Ltd

Tech + Aptitude written
2. Programming written ( main theme is to test our data structure knowledge, proficiency
sorting searching algorithms will clear this round )
3. Technical interview
4. Puzzle solving
Friends if u clear all this four rounds u are ready for ORACLE.


Which of the following statements contains an error?
a.. SELECT * FROM emp WHERE empid = 493945;
b. SELECT empid FROM emp WHERE empid= 493945;
c. SELECT empid FROM emp;
d. SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;
Which of the following correctly describes how to specify a column alias?
a. Place the alias at the beginning of the statement to describe the table.
b. Place the alias after each column, separated by white space, to describe the column.
c. Place the alias after each column, separated by a comma, to describe the column.
d. Place the alias at the end of the statement to describe the table.
The NVL function
a. Assists in the distribution of output across multiple columns.
b. Allows the user to specify alternate output for non-null column values.
c. Allows the user to specify alternate output for null column values.
d Nullifies the value of the column output
Output from a table called PLAYS with two columns, PLAY_NAME and AUTHOR,is shown below.Which of the following SQL statements produced it?
“Midsummer Night’s Dream”, SHAKESPEARE
“Waiting For Godot”, BECKETT
“The Glass Menagerie”, WILLIAMS

a SELECT play_name || author FROM plays;
b SELECT play_name, author FROM plays;
c SELECT play_name||’, ‘ || author FROM plays;
d SELECT play_name||’, ‘ || author PLAY_TABLE FROM plays;

Issuing the DEFINE_EDITOR=”emacs” will produce which outcome?
a. The emacs editor will become the SQL*Plus default text editor.
b. The emacs editor will start running immediately.
c. The emacs editor will no longer be used by SQL*Plus as the default text editor.
d. The emacs editor will be deleted from the system.
The user issues the following statement. What will be displayed if the EMPID selected is 60494? SELECT DECODE(empid,38475, “Terminated”,60494, “LOA”, “ACTIVE”)FROM emp;
a. 60494
b. LOA
c. Terminatedd. ACTIVE
SELECT (TO_CHAR(NVL(SQRT(59483), “INVALID”)) FROM DUAL is a valid SQL statement.
The appropriate table to use when performing arithmetic calculations on values defined within the SELECT statement (not pulled from a table column) is
a. EMP
b. The table containing the column values
c. DUALD. An Oracle-defined table
Which of the following is not a group function?
a. avg( )
c. sqrt( )
c. sum( )
d. max( )
Once defined, how long will a variable remain so in SQL*Plus?
a. Until the database is shut down
b. Until the instance is shut down
c. Until the statement completes
d. Until the session completes
The default character for specifying runtime variables in SELECT statements is
a. Ampersand
b. Ellipses
c. Quotation marks
d. Asterisk
A user is setting up a join operation between tables EMP and DEPT. There are some employees in the EMP table that the user wants returned by the query, but the employees are not assigned to departments yet. Which SELECT statement is most appropriate for this user?
a. select e.empid, d.head from emp e, dept d;
b. Select e.empid, d.head from emp e, dept d where e.dept# = d.dept#;
c. Select e.empid, d.head from emp e, dept d where e.dept# = d.dept# (+);
d. Select e.empid, d.head from emp e, dept d where e.dept# (+) = d.dept#;
Developer ANJU executes the following statement: CREATE TABLE animals AS SELECT * fromMASTER.ANIMALS; What is the effect of this statement?
a. A table named ANIMALS will be created in the MASTER schema with the same data as the ANIMALS table owned by ANJU
b. A table named ANJU will be created in the ANIMALS schema with the same data as the ANIMALS table owned by MASTER
c. A table named ANIMALS will be created in the ANJU schema with the same data as the ANIMALS table owned by MASTER.
d. A table named MASTER will be created in the ANIMALS schema with the same data as the ANJU table owned by ANIMALS.
User JANKO would like to insert a row into the EMPLOYEE table, which has three columns: EMPID,LASTNAME, and SALARY. The user would like to enter data for EMPID 59694, LASTNAME Harris, but no salary. Which statement would work best?
a. INSERT INTO employee VALUES (59694,’HARRIS’, NULL);
b. INSERT INTO employee VALUES (59694,’HARRIS’);
d. INSERT INTO employee (SELECT 59694 FROM ‘HARRIS’);
Which three of the following are valid database datatypes in Oracle? (Choose three.)
Omitting the WHERE clause from a DELETE statement has which of the following effects?
a. The delete statement will fail because there are no records to delete.
b. The delete statement will prompt the user to enter criteria for the deletion
c. The delete statement will fail because of syntax error.
d. The delete statement will remove all records from the table.
Creating a foreign-key constraint between columns of two tables defined with two different datatypes will produce an error.
Dropping a table has which of the following effects on a nonunique index created for the table?
a. No effect.
b. The index will be dropped.
c. The index will be rendered invalid.
d. The index will contain NULL values.
To increase the number of nullable columns for a table,
a. Use the alter table statement.
b. Ensure that all column values are NULL for all rows.
c. First increase the size of adjacent column datatypes, then add the column.
d. Add the column, populate the column, then add the NOT NULL constraint.
Which line of the following statement will produce an error?
b. (good_no NUMBER,
c. good_name VARCHAR2 check(good_name in (SELECT name FROM avail_goods)),
d. CONSTRAINT pk_goods_01
e. PRIMARY KEY (goodno));
f. There are no errors in this statement.
MAXVALUE is a valid parameter for sequence creation.
Which of the following lines in the SELECT statement below contain an error?
a SELECT DECODE(empid, 58385, “INACTIVE”, “ACTIVE”) empid
b. FROM emp
c. WHERE SUBSTR(lastname,1,1) > TO_NUMBER(‘S’)
d. AND empid > 02000
e. ORDER BY empid DESC, lastname ASC;
f. There are no errors in this statement.
Which function below can best be categorized as similar in function to an IF-THEN-ELSE statement?
Which two of the following orders are used in ORDER BY clauses? (choose two)
a. ABS
b. ASC

You query the database with this command SELECT name FROM employee WHERE name LIKE ‘_a%’; Which names are displayed?
a. Names starting with “a”
b. Names starting with “a” or “A”
c. Names containing “a” as second character
d. Names containing “a” as any letter except the firs


Which of the following statements is true about implicit cursors?
a. Implicit cursors are used for SQL statements that are not named.
b. Developers should use implicit cursors with great care.
c. Implicit cursors are used in cursor for loops to handle data processing.
d. Implicit cursors are no longer a feature in Oracle.
Which of the following is not a feature of a cursor FOR loop?
a. Record type declaration.
b. Opening and parsing of SQL statements.
c. Fetches records from cursor.
d. 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?
a. Use employee.lname%type.
b. Use employee.lname%rowtype.
c. Look up datatype for EMPLOYEE column on LASTNAME table and use that.
d. Declare it to be type LONG.
Which three of the following are implicit cursor attributes?
a. %found
b. %too_many_rows
c. %notfound
d. %rowcount
e. %rowtype
If left out, which of the following would cause an infinite loop to occur in a simple loop?
Which line in the following statement will produce an error?
a. cursor action_cursor is
b. select name, rate, action
c. into action_record
d. from action_table;
e. There are no errors in this statement.
The command used to open a CURSOR FOR loop is
a. open
b. fetch
c. parse
d. None, cursor for loops handle cursor opening implicitly
What happens when rows are found using a FETCH statement
a. It causes the cursor to close
b. It causes the cursor to open
c. It loads the current row values into variables
d. It creates the variables to hold the current row values
CREATE OR REPLACE PROCEDURE find_cpt (v_movie_id {ArgumentMode}NUMBER, v_cost_per_ticket {argument mode} NUMBER)IS
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;
Which mode should be used for V_COST_PER_TICKET?
a. IN
b. OUT
CREATE OR REPLACE TRIGGER update_show_gross {trigger information}
{additional code}
The trigger code should only execute when the column, COST_PER_TICKET, is greater than $3.75. Which trigger information will you add?
a. WHEN (new.cost_per_ticket > 3.75)
b. WHEN (:new.cost_per_ticket > 3.75
c. WHERE (new.cost_per_ticket > 3.75)
d. 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?
a. Only one
b. All that apply
c. All referenced
d. None
For which trigger timing can you reference the NEW and OLD qualifiers?
a. Statement and Row
b. Statement only
c. Row only
d. Oracle Forms trigger
CREATE OR REPLACE FUNCTION get_budget(v_studio_id IN NUMBER) RETURN number
ISv_yearly_budget NUMBER;
SELECT yearly_budget
INTO v_yearly_budget
FROM studio
WHERE id = v_studio_id;
RETURN v_yearly_budget;
Which set of statements will successfully invoke this function within SQL*Plus?
a VARIABLE g_yearly_budget NUMBER EXECUTE g_yearly_budget := GET_BUDGET(11);
b. VARIABLE g_yearly_budget NUMBER EXECUTE :g_yearly_budget := GET_BUDGET(11);
c. VARIABLE :g_yearly_budget NUMBER EXECUTE :g_yearly_budget := GET_BUDGET(11);
d. VARIABLE g_yearly_budget NUMBER :g_yearly_budget := GET_BUDGET(11);
CREATE OR REPLACE PROCEDURE update_theater (v_name IN VARCHAR2, v_theater_id IN NUMBER) IS
UPDATE theater
SET name = v_name
WHERE id = v_theater_id;
END update_theater;
When invoking this procedure, you encounter the error: ORA-00001: Unique constraint (SCOTT.THEATER_NAME_UK) violated.How should you modify the function to handle this error?
a. An user defined exception must be declared and associated with the error code and handled in the EXCEPTION
b. Handle the error in EXCEPTION section by referencing the error code directly.
c. Handle the error in the EXCEPTION section by referencing the UNIQUE_ERROR predefined exception.
d. Check for success by checking the value of SQL%FOUND immediately after the UPDAT statement.
CREATE OR REPLACE PROCEDURE calculate_budget IS v_budget studio.yearly_budget%TYPE;
v_budget := get_budget(11);
IF v_budget < 30000000 THEN set_budget(11,30000000); END IF; END; You are about to add an argument to CALCULATE_BUDGET. What effect will this have? a. The GET_BUDGET function will be marked invalid and must be recompiled before the next execution. b. The SET_BUDGET function will be marked invalid and must be recompiled before the next execution. c. Only the CALCULATE_BUDGET procedure needs to be recompiled. d. All three procedures are marked invalid and must be recompiled. 16. Which procedure can be used to create a customized error message? a. RAISE_ERROR b. SQLERRM c. RAISE_APPLICATION_ERROR d. RAISE_SERVER_ERROR 17. The CHECK_THEATER trigger of the THEATER table has been disabled. Which command can yo issue to enable this trigger? a. ALTER TRIGGER check_theater ENABLE; b. ENABLE TRIGGER check_theater; c. ALTER TABLE check_theater ENABLE check_theater; d. ENABLE check_theater; 18. 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? a. BEFORE DELETE ON gross_receipt b. AFTER DELETE ON gross_receipt c. BEFORE (gross_receipt DELETE) d. FOR EACH ROW DELETED FROM gross_receipt 19. 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? a. Add “RETURN;” right before the “IS” keyword. b. Add “RETURN number” right before the “IS” keyword. c. Add “RETURN boolean” right after the “IS” keyword. d. Add “RETURN boolean” right before the “IS” keyword. 20. Under which circumstance must you recompile the package body after recompiling the package specification? a. Altering the argument list of one of the package constructs b. Any change made to one of the package constructs c. Any SQL statement change made to one of the package constructs d. Removing a local variable from the DECLARE section of one of the package constructs 21. Procedure and Functions are explicitly executed. This is different from a database trigger. When is a database trigger executed? a. When the transaction is committed b. During the data manipulation statement c. When an Oracle supplied package references the trigger d. During a data manipulation statement and when the transaction is committed 22. Which Oracle supplied package can you use to output values and messages from database triggers, stored procedures and functions within SQL*Plus? a. DBMS_DISPLAY b. DBMS_OUTPUT c. DBMS_LIST d. DBMS_DESCRIBE 23. What occurs if a procedure or function terminates with failure without being handled? a. Any DML statements issued by the construct are still pending and can be committed or rolled back. b. Any DML statements issued by the construct are committed c. 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. 24. 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? a. 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. b. Only the GET_TOTAL_FOR_YEAR variable must exist in the specification of the T