250+ TOP MCQs on Perl DBI Overview and Answers

MySQL Database Multiple Choice Questions on “Perl DBI Overview”.

1. In Perl DBI, functions are called ______________
a) functions
b) procedures
c) methods
d) programs

Answer: c
Clarification: In the DBI API, functions are called and pointers to structures are used. The functions are called ‘methods’, pointers are called ‘references’, pointer variables are called ‘handles’.

2. Which variable is used as a handle to an open file?
a) $dbh
b) $sth
c) $fh
d) $h

Answer: c
Clarification: The variable named ‘$fh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.

3. The variable that is a handle to a database object is ______________
a) $dbh
b) $sth
c) $fh
d) $h

Answer: a
Clarification: The variable named ‘$dbh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.

4. Which variable returns code from operations that return true or false?
a) $rc
b) $rv
c) $rows
d) $ary

Answer: a
Clarification: The Perl Non-handle variable ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.

5. The statement to remove indexes on tables is ______________
a) DROP INDEX
b) DELETE INDEX
c) REMOVE INDEX
d) FLUSH INDEX

Answer: a
Clarification: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.

  250+ TOP MCQs on Internationalization and Localization Issues and Answers

6. What allows nesting one select statement into another?
a) nesting
b) binding
c) subquerying
d) encapsulating

Answer: c
Clarification: The ‘subquerying’ support provided by MySQL is a capability that allows writing one ‘SELECT’ statement within parentheses and nesting within another. This allows logically selecting content from tables.

7. The operator that does not perform relative-value comparisons is ______________
a) =
b) ==
c) <=
d) >=

Answer: b
Clarification: The operators =, <>, >, >=, <, and <= perform relative value comparisons in MySQL. ‘==’ is not a valid comparison operator in MySQL. Such operators are useful in filtering information from a table.

8. The key declares that an index in one table is related to that in another is called _____________
a) primary
b) secondary
c) foreign
d) cross

Answer: c
Clarification: In MySQL, a foreign key is the one that facilitates index relations across tables. It declares that an index in one table is related to that in another and place constraints.

9. Foreign keys can handle deletes and updates.
a) True
b) False

Answer: a
Clarification: A foreign key is the one which declares that an index in one table is related to that in another and place constraints. It is useful for handling deletes and updates along with row entries.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top