Oracle Database Fundamentals Quiz

Test your knowledge of Oracle database concepts including SQL syntax, constraints, indexes, triggers, and DML/DDL operations.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is true about triggers I. instead of trigger can be used on tables and views 2. instead of trigger can fire at eah row and statement levels. 3. Compund trigger in 10g allows us to specify multiple timig events on single database objects. 4. we should not use the same object which fired the trigger inside the trigger. this will result in mutating trigger error.

  1. 2 and 4 are true
  2. 1 , 3 and 4 are true
  3. 1 and 3 are true
  4. Only 4 is true
Question 2 Multiple Choice (Multiple Answers)

For which constraints are indexes created when the constraint is added?

  1. Check
  2. Unique
  3. Primary key
  4. not null
Question 3 Multiple Choice (Single Answer)

What is the difference between Union and Union all statements

  1. Union all used for combining multiples queries using single union all
  2. There is no difference
  3. the union will eliminate duplicate records in result set but, union all will print the duplicate records
  4. Union all is used for select with multiple columns
Question 4 Multiple Choice (Single Answer)

what is true about Delete and truncate 1. Truncate can not be used in PL/SQL 2. Delete will remove the data and will not move watermark. 3. Both statements require commit 4. truncate can remove selected records

  1. 1 and 2 are correct
  2. All are true
  3. 1,2 and 3 are correct
  4. 2,3 and 4 are correct
Question 5 Multiple Choice (Single Answer)

What is the default value for the OPTIMIZER_MODE initialization parameter?

  1. FIRST_ROWS
  2. ALL_ROWS
  3. CHOOSE
  4. COST
Question 6 True/False

Can we have multiple primary keys in a table?

  1. True
  2. False
Question 7 Multiple Choice (Multiple Answers)

Which are the aggregate functions?

  1. SUM
  2. AVG
  3. trim
  4. median
Question 8 True/False

We have unique constraint on sal column on emp table. can the column accept multiple null values?

  1. True
  2. False
Question 9 True/False

Can we have multiple check constraints on a single column of a table.

  1. True
  2. False
Question 10 Multiple Choice (Multiple Answers)

We can view the constraint details from following data dictionary views

  1. user_constraints
  2. user_tables
  3. user_cons_columns
  4. all_tab_cols
Question 11 Multiple Choice (Multiple Answers)

Comparision of Decode and case statement

  1. Both are same
  2. case can check for non equality operator but decode checks for equality operator
  3. decode can be used for comparing value of one variable/condition. but case can check for multiple conditions
  4. case can not be used in where clause. but decode can be used.
Question 12 Multiple Choice (Multiple Answers)

Evaluate the SQL statement: SELECT ROUND(45.953, -1), TRUNC(45.936, 2) FROM dual; Which values are displayed?

  1. 46 and 45
  2. 46 and 45.93
  3. 50 and 45.93
  4. 50 and 45.9
Question 13 Multiple Choice (Multiple Answers)

Which are DML statements? (Choose all that apply.)

  1. COMMIT
  2. MERGE
  3. UPDATE
  4. DELETE
  5. CREATE
  6. DROP
Question 14 Multiple Choice (Single Answer)

On which line will the following command fail? INSERT INTO plsql101_product ( product_name, product_price, quantity_on_hand, last_stock_date ) VALUES ( 'New Product', 1.95, 10, TO_CHAR(USER) ) ;

  1. 1
  2. 2
  3. 7
  4. 10
Question 15 Multiple Choice (Single Answer)

Evaluate the set of SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCHAR2(14), loc VARCHAR2(13)); ROLLBACK; DESCRIBE DEPT What is true about the set? A. The DESCRIBE DEPT statement displays the structure of the DEPT table. B. The ROLLBACK statement frees the storage space occupied by the DEPT table. C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist. D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.

  1. A
  2. B
  3. C
  4. D
Question 16 Multiple Choice (Single Answer)

Among these Which are the system variables

  1. SYSDATE
  2. USER
  3. USERENV
  4. ALL THE ABOVE
Question 17 Multiple Choice (Single Answer)

What would be the result of the following DECODE function? DECODE(‘B’, ‘A’, ‘One’, ‘E’, ‘Five’, ‘I’, ‘Nine’, ‘O’, ‘Fifteen’, ‘U’, ‘Twenty-one’, ‘N/A’ )

  1. One
  2. N/A
  3. Two
  4. Five
Question 18 Multiple Choice (Single Answer)

Evaluate this SQL statement: SELECT ename, sal, 12sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? Evaluate this SQL statement: SELECT ename, sal, 12sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? A. No change is required to achieve the desired results. B. SELECT ename, sal, 12*(sal+100) FROM emp; C. SELECT ename, sal, (12*sal)+100 FROM emp; D. SELECT ename, sal+100,*12 FROM emp;

  1. A
  2. B
  3. C
  4. D
Question 19 Multiple Choice (Single Answer)

Which of the following is NOT a benefit of indexes?

  1. Faster operation during INSERT commands
  2. Faster operation during UPDATE commands
  3. Faster operation during SELECT commands
  4. Faster operation during DELETE commands
Question 20 Multiple Choice (Single Answer)

Which of the following commands will rename a table?

  1. RENAME table_name new_table_name;
  2. RENAME table_name TO new_table_name;
  3. RENAME TABLE table_name new_table_name;
  4. RENAME TABLE table_name TO new_table_name;