Oracle PL/SQL and SQL Fundamentals

Covers Oracle database concepts including PL/SQL programming, SQL syntax, constraints, indexes, normalization, cursor operations, and transaction management.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Suppose in the declaration section of a PL/SQL block, you create but do not initialize a NUMBER variable. What will be the initial value of the variable when the block is executed?

  1. 0
  2. NULL
  3. Depends on the scale and precision of the datatype.
  4. Without initialization, a variable cannot be used in the executable section of the block.
Question 2 Multiple Choice (Multiple Answers)

A user executes a PL/SQL block containing complex data with several update and insert statements using multiple row subqueries and complex inline view. Under which of the following conditions will the database save the change after executing one or more PL/SQL blocks? (Choose two)

  1. When you disconnect from your session abnormally
  2. After PL/SQL block is executed successfully
  3. When you issue TRUNCATE command at SQL prompt
  4. When COMMIT command is issued
  5. When each UPDATE statement is executed
Question 3 Multiple Choice (Single Answer)

For an unconditional approach to a particular part of a complex PL/SQL block, which of the following control structures can be used?

  1. If-Then-Else
  2. While loop
  3. GOTO
  4. DECODE
Question 4 Multiple Choice (Single Answer)

You are declaring a variable of data type NUMBER in a PL/SQL block. During the execution of the PL/SQL block, a query returns seven rows, and the next FETCH statement is issued. If the variable was assigned a value by using %ROWCOUNT attribute, which of the following values will be stored in it?

  1. 0
  2. 8
  3. 7
  4. NULL
Question 5 Multiple Choice (Multiple Answers)

Which of the following statements about an SQL statement are not correct? (Choose two)

  1. SQL statements can be on one or more lines.
  2. Keywords cannot be split across lines.
  3. SQL statements are not case-sensitive, unless indicated.
  4. Keywords can be abbreviated.
  5. Place a slash on the last line in the buffer.
  6. You can use arithmetic operators in any clause of a SQL statement.
Question 6 Multiple Choice (Single Answer)

Suppose you have to remove a table. There are several indexes associated with this table. Which among the following would remove all the indexes associated with the table?

  1. DROP INDEX
  2. ALTER TABLE ....... DROP PRIMARY KEY CASCADE
  3. ALTER TABLE ....... DROP CONSTRAINT
  4. DROP TABLE
Question 7 Multiple Choice (Multiple Answers)

Which of the following are not legal?

  1. DECLARE V_Destination_India Number;
  2. DECLARE V_123, V_213, V_132 Varchar2(10);
  3. DECLARE V_sys Boolean := 1;
  4. DECLARE V_destination_India Number(4);
  5. DECLARE V_Hiredate NOT NULL DATE := '01-JAN-00';
Question 8 Multiple Choice (Multiple Answers)

Which three of the following methods make PL/SQL tables easier to use? (Choose three)

  1. EXISTS
  2. SUBSTR
  3. TRIM
  4. FLOOR
  5. COUNT
  6. UPPER
Question 9 Multiple Choice (Multiple Answers)

For which of the following tasks would it be most appropriate to use a PL/SQL WHILE loop?

  1. To add six new services to the SERVICE table
  2. To change MACHINE_ID 123456 to 456789 and change all others to 900000
  3. To change MACHINE_ID 123456 to 456789
  4. To add new services to the SERVICE table until finished
Question 10 Multiple Choice (Single Answer)

Examine the statement of correlated subquery in the following cursor declaration. DECLARE CURSOR c1 IS SELECT D1.deptno, D1.loc, E1.Totalemp FROM dept D1, (SELECT deptno, COUNT(*) Totalemp FROM emp GROUP BY deptno) E1 WHERE D1.deptno = E1.deptno AND E1.Totalemp > 6; Why does this statement result in an error?

  1. Parameter has to be used in this cursor to make its execution successful.
  2. Correlated subquery cannot be used in CURSOR declaration.
  3. Correlated FROM clause subquery cannot be used in CURSOR declaration.
  4. AND logical operator cannot be used in WHERE clause of cursor declaration.
  5. No logical error.
Question 11 Multiple Choice (Single Answer)

In which section is a user-defined exception trapped?

  1. Declaration
  2. Execution
  3. Exception
  4. Header
Question 12 Multiple Choice (Single Answer)

Which of the following architecture is used to support the agent or the application tier?

  1. simple
  2. two tier
  3. n tier
  4. client server
Question 13 Multiple Choice (Single Answer)

What is the purpose of SET DBMSSERVER OUTPUT ON

  1. TO PRINT
  2. TO COPY
  3. TO CONVERT
  4. TO SEE THE RESULT OF PL/SQL PROGRAMS ON DISPLAY
Question 14 Multiple Choice (Single Answer)

SQL is a product of ?

  1. ASCII
  2. ANSCI
  3. ORACLE
  4. DBMS
Question 15 Multiple Choice (Single Answer)

How many normalization processes are available in RDBMS

  1. 2
  2. 3
  3. 6
  4. 12
Question 16 Multiple Choice (Single Answer)

How many constraints are available in SQL

  1. 1
  2. 2
  3. 3
  4. 5
Question 17 Multiple Choice (Single Answer)

Auto commit occurs on

  1. On any DML
  2. On any DDL
  3. On both
  4. On none
Question 18 Multiple Choice (Single Answer)

Which component will never allocate memory from the larger pool

  1. Oracle Library Cache
  2. Oracle Parallel Query
  3. Oracle Recovery Manager
  4. Oracle Multithreaded Server
Question 19 Multiple Choice (Single Answer)

What is the main reason to create a reverse key index on a column

  1. The column is populated by sequence
  2. The column contains many different values
  3. The column is mainly used for value range scans
  4. The columns implementing an inverted list attribute.
Question 20 Multiple Choice (Single Answer)

What is the best table to be cached?

  1. Small table rarely retrieved with a full table scan
  2. Large table rarely retrieved with a full table scan
  3. Small table frequently retrieved with a full table scan
  4. Large table frequently retrieved with a full table scan