Database programming bca eight semester 2019 batch mcq with answersheetl
Batch 2019
Subject: Database programming
- 1 …………..are values used in PL/SQL blocks that do not change during execution.
a) Variables
b) Constants
c) Functions
d) CursorCorrect answer: b) Constants
Reason: In PL/SQL, constants are used to define values that remain unchanged throughout the execution of a block. Variables can change, while functions and cursors serve different purposes. - 2. Which of the following is not a correct syntax of IF statement?
a) IF-THEN statement
b) IF-THEN-ELSE statement
c) IF-THEN-ELSIF statement
d) IF-ELSE-THEN statementCorrect answer: d) IF-ELSE-THEN statement
Reason: The correct syntax for IF statements in PL/SQL isIF-THEN
,IF-THEN-ELSE
, andIF-THEN-ELSIF
. The sequence “IF-ELSE-THEN” does not exist in PL/SQL. - 3. What is NOT a selector in case of CASE statement?
a) Variable
b) Function
c) Expression
d) ProcedureCorrect answer: d) Procedure
Reason: In PL/SQL, selectors for the CASE statement include variables, functions, and expressions. A procedure cannot be used as a selector in a CASE statement. - 4. PL/SQL Loops are also known as –
a) Iterative Case Statements
b) Iterative Control Statements
c) Indentation Control Statements
d) Indentation Case StatementsCorrect answer: b) Iterative Control Statements
Reason: PL/SQL loops are categorized as iterative control statements because they control the repetition of code blocks. - 5. In the contexts created by Oracle, a cursor represents a
a) Function
b) Table
c) Pointer
d) ProcedureCorrect answer: c) Pointer
Reason: A cursor in Oracle represents a pointer to the result set of a query, allowing row-by-row processing. - 6. Which of the following PL/SQL Cursor is automatically generated by Oracle?
a) Implicit
b) Explicit
c) Hybrid
d) InheritCorrect answer: a) Implicit
Reason: Implicit cursors are automatically generated by Oracle for SQL statements that return only one row. Explicit cursors must be declared manually. - 7. Which clause(s) is not used to specify when the trigger will get executed?
a) BEFORE
b) AFTER
c) INSTEAD OF
d) INSPITE OFCorrect answer: d) INSPITE OF
Reason: The valid clauses for specifying trigger execution timing areBEFORE
,AFTER
, andINSTEAD OF
.INSPITE OF
is not a valid clause in PL/SQL triggers. - 8. WHEN condition is valid for which triggers?
a) Table Level Triggers
b) Row Level Triggers
c) Column Level Triggers
d) Database Level TriggersCorrect answer: b) Row Level Triggers
Reason: TheWHEN
condition is used in row-level triggers to specify that the trigger should only fire when certain conditions are met for each row. - 9. The exception thrown when more than one row is returned from a SELECT INTO statement?
a) MORE_THAN_ONE_ROW
b) MORE_ROWS
c) MANY_ROWS
d) TOO_MANY_ROWSCorrect answer: d) TOO_MANY_ROWS
Reason: TheTOO_MANY_ROWS
exception is raised when aSELECT INTO
statement returns more than one row, which violates the expectation of a single row. - 10. Which of the following combines the data manipulating power of SQL with the data processing power of procedural languages?
a) SQL
b) PQL
c) Advanced SQL
d) PL/SQLCorrect answer: d) PL/SQL
Reason: PL/SQL (Procedural Language/Structured Query Language) combines SQL’s data manipulation capabilities with procedural programming features, allowing for more complex data processing.
Don’t Forget to Follow
Facebookpage: BCANotesnepal
Facebook ID: Bcanotesnepal
Facebook Group: BCA Notes Nepal
Website: www.bcanotesnepal.com