0% found this document useful (0 votes)
8 views17 pages

MCQS RDBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views17 pages

MCQS RDBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

RDBMS MCQ FOR ALL UNITS

Unit 1
1. Words used in a PL/SQL block are called ______________.
a) Lexical Units
b) Literals
c) Constant
d) Variable

2. Full form of PL/SQL.


a) Procedural Language/Structured Query Language
b) Programming Logic/System Query Language
c) Programming Language/Syntax Query Language
d) Procedural Logic/Structured Query Language

3. Which is not the type of literal.


a) Variable Literal
b) Numeric Literals
c) String Literal
d) Character Literal

4. ________ is combination of SQL along with the procedural capabilities of


programming language.
a) PL/SQL
b) T-SQL
c) SQL*Plus
d) MySQL

5. Which assignment operator is used to assign value to the variable in the


PL/SQL.
a) ::=
b) :==
c) :=
d) ==

6. The ______statement changes the flow of control within a PL/SQL block.


a) Break
b) Goto
c) Select
d) Jump
RDBMS MCQ FOR ALL UNITS

7. Which one of the following is not the types of loop in PL/SQL.


a) For Loop
b) Simple Loop
c) Do While Loop
d) While Loop

8. __________ declares a variable or constant to have the same datatype as


that of a previously defined column in a table.
a) *TYPE
b) %TYPE
c) %ROWTYPE
d) *ROWTYPE

9. A variable name must begin with a character and can be followed by a


maximum of __________ other characters.
a) 28
b) 29
c) 30
d) 31

10. Declaring a constant is similar to declaring a variable except that the


keyword ___________ must be added and immediately assign a value to it.
a) Variable
b) Constant
c) Type
d) Begin

11. In which section of PL/SQL block of code memory variables and other
Oracle objects can be declared.
a) End
b) Begin
c) Declare
d) Exception
RDBMS MCQ FOR ALL UNITS
12. Which section of PL/SQL code block deals with handling of errors that arise
during execution of the data manipulation statements.
a) End
b) Begin
c) Declare
d) Exception

13. Below is the syntax of which loop.


LOOP
Sequence of statements;
END LOOP;

a) For Loop
b) Simple Loop
c) Single Loop
d) While Loop

14. A ______ is a numeric value or a character string to represent itself.


a) Character Literal
b) Lexical Units
c) Literals
d) String

15. The ___________ attribute is used to declare variables based on definitions


of columns in a table.
a) *TYPE
b) %TYPE
c) %ROWTYPE
d) *ROWTYPE

16. Which of the following is not the feature of Pl/SQL.


a) Exception handling
b) Object-Oriented Programming
c) Programming Structures
d) Integration with SQL

17. PL/SQL Code blocks starts with a ____ section.


a) End
b) Begin
c) Declare
d) Exception
18. which section marks the end of a PL/SQL block.
RDBMS MCQ FOR ALL UNITS
a) End
b) Begin
c) Declare
d) Exception

19. Below is the syntax of which loop.


WHILE <Condition>
LOOP
<Action>
END LOOP;

a) For Loop
b) Simple Loop
c) Single Loop
d) While Loop

20. _______ is development tool that not only support SQL data manipulation
but also provides facilities of conditional checking, branching and looping.
a) PL/SQL
b) T-SQL
c) SQL*Plus
d) MySQL
RDBMS MCQ FOR ALL UNITS
Unit 2
1. Which of the following event starts a transaction?
a) A commit statement is issued
b) User disconnects with the database
c) The first SQL statement is performed after connecting to a database
d) A DDL statement such as, CREATE command is issued
2. Which of the following syntax is correct for creating a savepoint in
PL/SQL?
a) SAVEPOINT;
b) <savepoint_namecc;
c) <savepoint_name> SAVEPOINT;
d) SAVEPOINT <savepoint_name>
3. Which of the following implicit cursor returns the count of rows affected by
an INSERT, UPDATE or DELETE statement?
a) %FOUND
b) %NOTFOUND
c) %ISOPEN
d) %ROWCOUNT
4. Which of the following is the correct syntax to access a implicit SQL cursor
attribute?
a) select%attribute_name
b) oracle%attribute_name
c) sql%attribute_name
d) %attribute_name
5. Which of the following is the correct syntax for creating an explicit cursor?
a) cursor_name IS column_name;
b) CURSOR cursor_name IS SELECT_statement;
c) cursor_name CURSOR IS SELECT_statement;
d) CURSOR cursor_name IS column_name;

6. Which of the following is the correct syntax to FETCH the cursor in


PL/SQL?
a) FETCH cursor_name INTO variable_list;
b) FETCH cursor_name IN variable_list;
c) FETCH cursor_name AS variable_list;
d) FETCH cursor_name variable_list;
RDBMS MCQ FOR ALL UNITS
7. If a transaction has obtained a __________ lock, it can read but cannot write
on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode
8. A transaction can proceed only after the concurrency control manager
________ the lock to the transaction
a) Grants
b) Requests
c) Allocates
d) None of the mentioned

9. How many steps are associated when working with an explicit cursor?
a) 3
b) 4
c) 5
d) 6

10 Which statements execute a sequence of statements multiple times?


a. LOOP statement
b. NULL statement
c. MERGE statement
d. None of the above

11 A series of one or more SQL statement that are logically related, or a series
of operations we performed on oracle table data is termed as ______
a. Rollback
b. Commit
c. Oracle transaction
d. Concurrency control

12. A _______ends the current transaction and makes permanent any changes made
during the transaction.
A. COMMIT
B. ROLLBACK
C. SAVEPOINT
D. ROLLBACK TO SAVEPOINT
RDBMS MCQ FOR ALL UNITS
13 The data that is stored in the cursor is called the ____
A. database
B. table
c. Active dataset
d. none of above

14 In _____ processing records are manipulated as they are created.


a. batch processing
b. real time processing
c. implicit cursor
d. explicit cursor

15. The_______statement retrives the rows from the active set opened in the server.
a. fetch
b. open
c.close
d.declare

16.____allows passing value dynamically to a cursor while opening a cursor.


a. cursor for loop
b. explicit cursor
c. parameterized cursor
d. none of above

17. oracle uses a method called ______to implement concurrency control.


a. commit
b. rollback
c. locking
d. all of above

18. The technique of lock taken on a table or its resources by a user is called _________

a. implicit locking
b. explicit locking
c. shared locks
d. exclusive locks

19. _____ indicates that the oracle engine should immediate return to the user with a
message.
a. nowwait
b. for update
c. read operations
d. write operations
RDBMS MCQ FOR ALL UNITS
20. if the where clause evaluates to set of data, a ___level lock is used.
a. row
b. page
c. table
d. database
RDBMS MCQ FOR ALL UNITS
Unit 3

1. What is a stored procedure or function in Oracle?


A. A named PL/SQL code block that is executed manually without storage.
B. A named PL/SQL code block that is compiled and stored in Oracle's system tables.
C. A PL/SQL code block that can only be used once.
D. A SQL statement that modifies data directly.

2. What are the main parts of a Procedure or Function?


A. Declarative, Execution, Data-handling
B. Declarative, Executable, Exception-handling
C. Executable, Data-storage, Compilation
D. Declaration, Execution, Termination

3. Which part of a procedure contains cursor, variable, and exception


declarations?
A. Declarative part
B. Executable part
C. Exception-handling part
D. Compilation part

4. Where do stored procedures and functions reside in Oracle?


A. In the user's local machine memory.
B. In the Oracle database system tables.
C. In the operating system’s temporary storage.
D. In a remote server.
RDBMS MCQ FOR ALL UNITS
5. What part of the procedure or function handles unexpected errors?
A. Declarative part
B. Exception-handling part
C. Execution part
D. Data-handling part
6. Which parameter mode allows both passing a value into a procedure and
returning a value from it?
A. IN
B. OUT
C. IN OUT
D. RETURN

7. What is required when creating a function but not necessarily when creating a
procedure?
• A. IN parameters
• B. OUT parameters
• C. A RETURN data type
• D. An EXCEPTION block

8. Which of the following SQL statements is used to delete a stored procedure?


• A. DELETE PROCEDURE <procedurename>;
• B. REMOVE PROCEDURE <procedurename>;
• C. DROP PROCEDURE <procedurename>;
• D. ERASE PROCEDURE <procedurename>;

9. How can multiple values be returned to the caller from a procedure?


• A. By using multiple RETURN statements.
• B. By defining multiple OUT parameters.
RDBMS MCQ FOR ALL UNITS
• C. By using a SELECT statement within the procedure.
• D. By returning a cursor

10. What is the purpose of the EXCEPTION block in a PL/SQL procedure or


function?
• A. To define variables and constants.
• B. To handle errors that occur during the execution of the procedure or
function.
• C. To execute the procedure without errors.
• D. To return the results of the procedure or function

11. What is the full form of SGA in Oracle?


• A. System General Area
• B. Shared Global Access
• C. System Global Area
• D. Shared General Allocation

12. How many values a function can return to the calling PL/SQL code block.
A. ONE
B. TWO
C. THREE
D. FOUR

13. WHICH parameter is used to return values out of the procedure.


A. IN
B. OUT
C. IN OUT
D. RETURN
RDBMS MCQ FOR ALL UNITS
14. What is an error that occurs during program execution in PL/SQL called?
• A. Bug
• B. Exception
• C. Runtime error
• D. Syntax error

15. Which of the following is a Named Exception Handler in PL/SQL?


• A. NULL_POINTER
• B. DUP_VAL_ON_INDEX
• C. VALUE_OUT_OF_RANGE
• D. NO_TRANSACTION

16. Which exception is raised when an attempt is made to insert a duplicate value
into a column with a unique index?
• A. NO_DATA_FOUND
• B. LOGIN_DENIED
• C. DUP_VAL_ON_INDEX
• D. TIMEOUT_ON_RESOURCE

17. Which of the following is used to bind a numbered exception to a name in


PL/SQL?
• A. RAISE EXCEPTION
• B. PRAGMA EXCEPTION_INIT
• C. EXCEPTION_HANDLER_INIT
• D. CREATE EXCEPTION_HANDLER
RDBMS MCQ FOR ALL UNITS
18. Which of the following is an example of a user-defined exception?
• A. NO_DATA_FOUND
• B. DUP_VAL_ON_INDEX
• C. invalid_salary
• D. LOGIN_DENIED

19. Which of the following exceptions is raised when a SELECT statement returns
zero rows?
• A. TOO_MANY_ROWS
• B. NO_DATA_FOUND
• C. LOGIN_DENIED
• D. DUP_VAL_ON_INDEX
20. How many parameters Exception_init() function will take?
• A. ONE
• B. TWO
• C. THREE
• D. FOUR
RDBMS MCQ FOR ALL UNITS
UNIT 4
1. Any subprogram not in the package specification but coded in the package body is
called a __________
a. Public object
b. Private object
c. Both A & B
d. None of the above

2. You can pass parameters to procedures or functions in a package.


a) True
b) False

3. Packages are schema objects.


a) True
b) False

4. All objects placed within the package specification are known as which objects?
a) Private Objects
b) Protected Objects
c) Public Objects
d) Normal Objects

5. The public elements of a package can be accessed using which of the following
symbol?
a) *
b) =
c) .
d) ->

6. Which of the following syntax is the correct way to access a package element?
a) package.element_name;
b) element_name.package;
c) element_name.package_name;
d) package_name.element_name;
RDBMS MCQ FOR ALL UNITS
7. The __________ Statement is used for creating the package body.
a) CREATE
b) CREATE PACKAGE
c) CREATE BODY
d) CREATE PACKAGE BODY

8. Which of the following is the FIRING POINT: BEFORE?

a) BEFORE INSERT TRIGGER


b) BEFORE UPDATE TRIGGER
c) BEFORE DELETE TRIGGER
d) All of the above

9. What are the parameters in the Oracle BEFORE INSERT/UPDATE/DELETE trigger


statement?
a) OR REPLACE
b) Trigger_name
c) Table_name
d) All of the above

10. Whenever a specified event occurs, the ____ is automatically triggered by the
Oracle engine.

a) Cursor
b) Trigger
c) Exception
d) View

11 What does INSERT or UPDATE or DELETE clauses do in Trigger syntax?

A. DML Operation is performed


B. DDL Operation is performed
C. DCL Operation is performed
D. TCL Operation is performed
RDBMS MCQ FOR ALL UNITS
12 What does REFERENCING OLD AS o NEW AS n clause do in trigger?

A. This clause is used to refer the old values for different DML statements.
B. This clause is used to refer the new values for different DML statements.
C. Both A. and B.
D. None of the above

13 Which of the following is an advantage of trigger?

A. Imposing authorizations for security


B. Keeping track of table access events and logging them
C. Auditing
D. All of the above

14 WHEN condition is valid for which triggers?

A. Table Level Triggers


B. Row Level Triggers
C. Column Level Triggers
D. Database Level Triggers

15 Which clause(s) is/are used to specify when the trigger will get executed?

A. BEFORE
B. AFTER
C. INSTEAD OF
D. All of the above
16 Triggers can be defined on the?

A. table
B. view
C. schema
D. All of the above
RDBMS MCQ FOR ALL UNITS
17. What is the range of Raise_application_error?
a) 20000 to 20009
b) -20000 to -20999
c) -20000 to 20999
d)None of the above.

18) A __________ is a special kind of a store procedure that executes in response to


certain action on the table like insertion, deletion or updating of data.
a) Procedures
b) Triggers
c) Functions
d) None of the mentioned

19) Triggers are not supported for


a) Delete
b) Update
c) Views
d) Insert

20) The CREATE TRIGGER statement is used to create the trigger. THE _____ clause
specifies the table name on which the trigger is to be attached. The ______ specifies
that this is an AFTER-INSERT trigger.
a) for insert, on
b) On, for insert
c) For, insert
d) None of the mentioned

You might also like