Oracle Test
Oracle Test
Oracle Test
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.
4. Output from a table called PLAYS with two columns, PLAY_NAME and AUTHOR, is
shown below. Which of the following SQL statements produced it?
PLAY_TABLE
-------------------------------------
"Midsummer Night's Dream", SHAKESPEARE
"Waiting For Godot", BECKETT
"The Glass Menagerie", WILLIAMS
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.
6. The user issues the following statement. What will be displayed if the EMPID selected
is 60494?
A. 60494
B. LOA
C. Terminated
D. ACTIVE
A. TRUE
B. FALSE
A. EMP
B. The table containing the column values
C. DUAL
D. An Oracle-defined table
A. avg( )
B. sqrt( )
C. sum( )
D. max( )
11. The default character for specifying runtime variables in SELECT statements is
A. Ampersand
B. Ellipses
C. Quotation marks
D. Asterisk
12. 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?
13. Developer ANJU executes the following statement: CREATE TABLE animals AS
SELECT * from MASTER.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.
14. 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?
15. Which three of the following are valid database datatypes in Oracle? (Choose three.)
A. CHAR
B. VARCHAR2
C. BOOLEAN
D. NUMBER
16. 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.
17. Creating a foreign-key constraint between columns of two tables defined with two
different datatypes will produce an error.
A. TRUE
B. FALSE
18. 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.
A. TRUE
B. FALSE
22. Which of the following lines in the SELECT statement below contain an error?
A. SQRT
B. DECODE
C. NEW_TIME
D. ROWIDTOCHAR
24. Which two of the following orders are used in ORDER BY clauses? (choose two)
A. ABS
B. ASC
C. DESC
D. DISC
SELECT name
FROM employee
WHERE name LIKE ‘_a%’;
PL/SQL
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.
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.
29. Which three of the following are implicit cursor attributes?
A. %found
B. %too_many_rows
C. %notfound
D. %rowcount
E. %rowtype
30. If left out, which of the following would cause an infinite loop to occur in a simple
loop?
A. LOOP
B. END LOOP
C. IF-THEN
D. EXIT
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.
A. open
B. fetch
C. parse
D. None, cursor for loops handle cursor opening implicitly.
33. What happens when rows are found using a FETCH statement
A. IN
B. OUT
C. RETURN
D. IN OUT
The trigger code should only execute when the column, COST_PER_TICKET, is greater
than $3.75. Which trigger information will you add?
36. 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
37. For which trigger timing can you reference the NEW and OLD qualifiers?
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?
39.
CREATE OR REPLACE PROCEDURE update_theater
(v_name IN VARCHAR2, v_theater_id IN NUMBER) IS
BEGIN
UPDATE theater
SET name = v_name
WHERE id = v_theater_id;
END update_theater;
A. An user defined exception must be declared and associated with the error code and handled
in the EXCEPTION section.
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 UPDATE
statement.
40.
CREATE OR REPLACE PROCEDURE calculate_budget IS
v_budget studio.yearly_budget%TYPE;
BEGIN
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.
A. RAISE_ERROR
B. SQLERRM
C. RAISE_APPLICATION_ERROR
D. RAISE_SERVER_ERROR
42. The CHECK_THEATER trigger of the THEATER table has been disabled. Which
command can you issue to enable this trigger?
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?
IF SQL%FOUND THEN
RETURN TRUEl;
ELSE
RETURN FALSE;
END IF;
COMMIT;
END;
45. Under which circumstance must you recompile the package body after recompiling
the package specification?
46. Procedure and Functions are explicitly executed. This is different from a database
trigger. When is a database trigger executed?
47. 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
48. 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.
D. The construct rolls back any DML statements issued and returns the unhandled exception to
the calling environment.
BEGIN
theater_pck.v_total_seats_sold_overall := theater_pck.get_total_for_year;
END;
50. 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?
A. DBMS_DDL
B. DBMS_DML
C. DBMS_SYN
D. DBMS_SQL