Database Fundamentals: Keys, Cursors, and PL/SQL

Quiz covering database concepts including primary keys, transactions, cursors, indexes, PL/SQL programming, triggers, and constraints in DB2 and Oracle.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Cascade option is used

  1. disable dependent integrity constraint
  2. deactivate an integrity constraint
  3. both of above
  4. none of above
Question 2 Multiple Choice (Single Answer)

To View all constraint definition and name table used is

  1. sys_constraints
  2. user_constraints
  3. tab_constraints
  4. col_constraints
Question 3 Multiple Choice (Single Answer)

View column associated with the constraint names view used is

  1. user_tab_columns
  2. user_cons_columns
  3. user_sys_columns
  4. all of above
Question 4 True/False

can we insert a record in dual?

  1. True
  2. False
Question 5 True/False

Can a primary key contain more than one columns?

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

Which one among the following is more faster?

  1. IN
  2. EXISTS
  3. LIKE
  4. EXIST
Question 7 True/False

Can we use a scalar data type as return type for CURSOR?

  1. True
  2. False
Question 8 True/False

Can cursor variables be stored in PL/SQL tables?

  1. True
  2. False
Question 9 True/False

Can a function take OUT parameters.?

  1. True
  2. False
Question 10 True/False

Can the default values be assigned to actual parameters?

  1. True
  2. False
Question 11 True/False

Can you use a commit statement within a database trigger?

  1. True
  2. False
Question 12 True/False

Can we call a procedure from Anonymous PL/SQL block?

  1. True
  2. False
Question 13 True/False

can we have more than one column of BLOB(data type to store images) in a table?

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

Which of the following can duplicate the structure and related objects of a database table?

  1. Copy table
  2. Alter table
  3. Export table
  4. Generate DDL
Question 15 Multiple Choice (Single Answer)

DB2 Cursor Stablity i) Cursor Stablity Leads to Higher concurency ii) Repeatable Read Leads to Higher consistency

  1. Both are True
  2. i) Is Only True
  3. ii) is only True
  4. Neither is True
Question 16 Multiple Choice (Single Answer)

DB2 Indexes i ) Unique Index can be created only on Primary Key. ii) Query will execute faster if predicates are applied on Indexed column.

  1. Both are True
  2. i) Is Only True
  3. ii) is only True
  4. Neither is True
Question 17 Multiple Choice (Single Answer)

DB2 Index Storate Format Indexes is Stored in

  1. B - Tree format
  2. Hash Table
  3. AVL Tree
  4. Red Black Tree
Question 18 Multiple Choice (Single Answer)

When do you open cursor before Fetching i) Cursor should always be Opened before Fetching ii) Fetch Operation cursor retrieves Only ONE row for every execution.

  1. Both are True
  2. i) Is Only True
  3. ii) is only True
  4. Neither is True
Question 19 Multiple Choice (Single Answer)

Two or more transactions in a simultaneous wait state, each waiting for other to release before it can proceed, is called

  1. Lost Update
  2. uncommitted dependency
  3. infinite loop
  4. Deadlock
  5. With hold
Question 20 Multiple Choice (Single Answer)

Which of the following is TRUE about Primary Key?

  1. Same value of Primary Key can appear in more than one row in the table
  2. A Primary key defined column can be of type LONG
  3. A column that is defined as Primary Key cannot contain NULL value.
  4. Both A. and B.