Questions Related to databases

Multiple choice technology databases
  1. Begin Dbms_output.put_line('Heello World'); exception when others then Dbms_output.put_line('error'); end; /

  2. Begin null; End;

  3. Declare a varchar2(100) := 'Hello World'; Begin Dbms_output.put_line(a); exception when others then Dbms_output.put_line('error'); end; /

  4. begin Dbms_output.put_line('Heello World'); end; /

Reveal answer Fill a bubble to check yourself
B Correct answer
Multiple choice technology databases
  1. Case [ TRUE | selector_variable ]] When [criteria1 | expression1 ] then criteria1_statements; When [criteria1 | expression1 ] then Criteria2_statements; Else block statement; end;

  2. Case value case [criteria1 | expression1 ] then criteria1_statements; case [criteria1 | expression1 ] then Criteria2_statements; Else block statement; end case;

  3. Case [ TRUE | selector_variable ]] When [criteria1 | expression1 ] then criteria1_statements; When [criteria1 | expression1 ] then Criteria2_statements; Else block statement; end case;

  4. Case [ TRUE | selector_variable ]] Loop When [criteria1 | expression1 ] then criteria1_statements; When [criteria1 | expression1 ] then Criteria2_statements; Else block statement; end Loop;

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology databases
  1. The exception B will be handled in inner block

  2. The exception B will be handled in outer block exception handler

  3. The exception will not be handled as there is no handler defined for B in inner block

  4. The exception section in inner block is executed and also Outer block exception section as we have defined there too

Reveal answer Fill a bubble to check yourself
B Correct answer
Multiple choice technology databases
  1. For cursor fetching we have to use Cursor For loops

  2. There is no close statement for closing the cursor statement

  3. No errors in the block

  4. No exception handler found

Reveal answer Fill a bubble to check yourself
B Correct answer
Multiple choice technology databases

CREATE OR REPLACE FUNCTION dml_call_sql (p_sal NUMBER) RETURN NUMBER IS BEGIN INSERT INTO employees(employee_id, last_name, email, hire_date, job_id, salary) VALUES(1, 'employee 1', '[email protected]', SYSDATE, 'SA_MAN', 1000); RETURN (p_sal + 100); END; / Function created. UPDATE employees SET salary = dml_call_sql(2000) WHERE employee_id = 170; What is the error in the block

  1. No errors in the block

  2. ORA-04091: table PLSQL.employees is mutating. Trigger/function may not see it. ORA-06512: at PL/SQL "DBMS_CALL_SQL"

  3. There is no exception handler in the function

  4. No rows updated exception will occur

Reveal answer Fill a bubble to check yourself
B Correct answer