SQL and PL/SQL Fundamentals

Test your knowledge of SQL functions, PL/SQL programming, stored procedures, triggers, transactions, and Oracle database features

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What part of a databse trigger determine the number of times the trigger body excutes?

  1. Trigger type
  2. Trigger body
  3. Trigger event
  4. Trigger timing
Question 2 Multiple Choice (Single Answer)

If the below block, when you execute then what will be the output? Begin Null; Exception When others then Dbms_output.put_line(‘ I am in Others Exception’); When no_data_found then Dbms_output.put_line(‘ I am in no data found Exception’); End;

  1. I am in Others Exception
  2. I am in no data found Exception
  3. Compilation Error
  4. None of the above
Question 3 Multiple Choice (Single Answer)

What are the different methods for passing parameters to Procedure?

  1. Positional & Named
  2. Positional alone
  3. Positional ,Name and Combination
  4. None of the above
Question 4 Multiple Choice (Single Answer)

How can you find within a PL/SQL block, if a cursor is open?

  1. %OPEN
  2. %ISOPEN
  3. 1 & 2
  4. None of the above
Question 5 Multiple Choice (Single Answer)

What is the use of %ROWTYPE in PL/SQL?

  1. %ROWTYPE allows you to associate a variable with an entire table row
  2. %ROWTYPE associates a variable with a single column type
  3. Both of the above
  4. None of the above
Question 6 Multiple Choice (Single Answer)

I have just now created sequence abc and If you immediately run the below select statement , what is the output? CREATE SEQUENCE abc MINVALUE 1 MAXVALUE 10 START WITH 1 INCREMENT BY 1 CACHE 20 Select abc.currval from dual;

  1. 1
  2. Null
  3. Error
  4. None of the above
Question 7 Multiple Choice (Single Answer)

What is the maximum number of columns in table or view in Oracle?

  1. 900
  2. 1000
  3. 1100
  4. 1050
Question 8 Multiple Choice (Single Answer)

What are the Sql Cursor Attributes in Pl/sql?

  1. SQL%ROWCOUNT, SQL%ISFOUND,SQL%NOTFOUND,SQL%ISOPEN
  2. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%OPEN
  3. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%ISOPEN
  4. All of the above
Question 9 Multiple Choice (Single Answer)

Raw types are used to store _________ data.

  1. binary
  2. Character
  3. ASCII
  4. All of the above
Question 10 True/False

SQL has facility for programmed handling of errors that arise during the manipulation of data.

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

_________ data type stores unstructured binary data upto 4GB length.

  1. CLOB
  2. BLOB
  3. LONG
  4. All of the above
Question 12 Multiple Choice (Single Answer)

In a PL/SQL block structure, which parts are optional?

  1. DELCARE and BEGIN
  2. DECALRE and EXCEPTION
  3. EXCEPTION and END
  4. BEGIN and END
Question 13 Multiple Choice (Multiple Answers)

Under which two circumstances do you design database triggers? (Choose two)

  1. To duplicate the functionality of other triggers.
  2. To replicate built-in constraints in the Oracle server such as primary key and foreign key.
  3. To guarantee that when a specific operation is performed, related actions are performed.
  4. For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.
Question 14 Multiple Choice (Single Answer)

Which of the following are not operators you can use in a math formula within a SQL statement?

  1. +
  2. (
  3. ]
  4. /
Question 15 Multiple Choice (Single Answer)

What is the proper syntax for assigning a column alias?

  1. SELECT column_name ALIAS alias_name FROM table_name;
  2. SELECT column_name alias_name FROM table_name;
  3. SELECT alias_name FROM table_name;
  4. ASSIGN alias_name TO column_name;
Question 16 Multiple Choice (Single Answer)

Which of the following are reasonable series of transaction-control commands?

  1. Insert some records, COMMIT, ROLLBACK
  2. SAVEPOINT, insert some records, ROLLBACK, ROLLBACK, COMMIT
  3. ROLLBACK, insert some records, COMMIT
  4. ROLLBACK, insert some records, COMMIT, COMMIT
Question 17 Multiple Choice (Single Answer)

Which of the following shows the wildcards for a single character and multiple characters, respectively?

  1. ?, *
  2. _, %
  3. ?, _
  4. *, %
Question 18 Multiple Choice (Single Answer)

Which statement below is true?

  1. ROUND(4.5, 0) < TRUNC(4.5, 0)
  2. ROUND(4.1, 0) < TRUNC(4.2, 0
  3. ROUND(8.9, 0) > TRUNC(8.9, 0)
  4. ROUND(8.9, 1) > TRUNC(8.95, 2)
Question 19 True/False

A trigger is a special type of stored procedure that is executed by the SQL Server when an Insert, Modify or Delete operation is performed Against a given table.

  1. True
  2. False
Question 20 True/False

Stored procedures are the way to create routines and procedures that are run on the server.

  1. True
  2. False