Tag: databases

Questions Related to databases

Identify the correct output --- select LAST_DAY(TO_DATE('01-SEP-1995', 'DD-MON-YYYY')) from dual;

  1. 31-AUG-1995

  2. 30-SEP-1995

  3. 31-OCT-1995

  4. 31-DEC-1995


Correct Option: B

WHERE clause is used to restrict groups

  1. True

  2. False


Correct Option: B

One can NOT delete a row from the VIEW if view definition contains ... Choose all that apply

  1. WHERE clause

  2. GROUP BY clause

  3. GROUP functions

  4. DISTINCT keyword

  5. FROM clause


Correct Option: B,C,D

An application developer wants to query row count of a table, ORDERS which has millions of records. ORDERS table has composite PRIMARY KEY on (ORDER_ID, CUSTOMER_ID) columns and those two columns appear at position 1 and 2 respectively in the ORDERS table. Which query will be more efficient?

  1. select count(*) from orders;

  2. select count(1) from orders;

  3. select count(3) from orders;

  4. select count(5) from orders;


Correct Option: B

Identify the MANDATORY sections of a PL/SQL block

  1. DECLARE

  2. BEGIN

  3. EXCEPTION

  4. END


Correct Option: B,D

Within a PL/SQL block, which commands are allowed? Choose all that apply

  1. SELECT

  2. CREATE

  3. DELETE

  4. DROP

  5. UPDATE

  6. INSERT


Correct Option: A,C,E,F

INSERT, UPDATE, DELETE commands when used in a PL/SQL block, should contain INTO clause to hold the data returned by SQL statement

  1. True

  2. False


Correct Option: B

IF-THEN-ELSE-ENDIF construct is used for conditional control in a PL/SQL block. What happens if the condition in IF-THEN-ELSE-ENDIF block evaluates to NULL?

  1. The SQL statements in the IF condition are processed.

  2. The SQL statements in the ELSE condition are processed.

  3. IF-THEN-ELSE-ENDIF construct is skipped.

  4. The SQL statements in the IF condition as well as ELSE condition are processed.


Correct Option: C