MySQL Questions and Answers – Perl DBI Overview – 2

This set of MySQL test focuses on “Perl DBI Overview – 2”.

1. The generic handle whose meaning depends on context is ______________
a) $dbh
b) $sth
c) $fh
d) $h
View Answer

Answer: d
Explanation: 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.

2. The non handle array representing a row of values is ______________
a) $rc
b) $rv
c) $rows
d) $ary
View Answer

Answer: d
Explanation: The Perl Non-handle variable ‘$ary’ is an array or list representing a row of values returned by a query. ‘$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.

3. The return value from operations returning a row count is ______________
a) $rc
b) $rv
c) $rows
d) $ary
View Answer

Answer: c
Explanation: The Perl Non-handle variable ‘$ary’ is an array or list representing a row of values returned by a query. ‘$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.
advertisement
advertisement

4. While using DBI API functions are called and pointers to structures are used.
a) True
b) False
View Answer

Answer: a
Explanation: While using 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”.

5. Which mode of search is the search string parsed into words and the search looks for rows?
a) Boolean mode
b) Natural language
c) Query expansion
d) Cross mode
View Answer

Answer: b
Explanation: In MySQL, a full text search capability is provided, which enables to look for words or phrases without using pattern-matching operations. There are three kinds of full text searches.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. The indicator of presence/absence of a word in search is used in the mode ______________
a) Natural language
b) Boolean mode
c) Query expansion
d) Cross mode
View Answer

Answer: b
Explanation: A full text search capability is provided in MySQL. It facilitates to look for words or phrases without using pattern-matching operations. Boolean search is one of the three modes.

7. The numbers that are prefixed with ‘0x’ are in base __________
a) 8
b) 16
c) 32
d) 64
View Answer

Answer: b
Explanation: In MySQL, there are many numeric datatypes. They include integers and floating points. For example, 34, 12.3, -1.3E11. The numbers that are prefixed with ‘0x’ are in hexadecimal.
advertisement

8. Hexadecimal numbers can be used in scientific notation.
a) True
b) False
View Answer

Answer: b
Explanation: The scientific notation for real numbers is possible in MySQL. Approximate values are represented as floating point numbers in scientific notation. It consists of a mantissa and exponent.

9. What is the escape sequence for carriage return?
a) ‘\c’
b) ‘\r’
c) ‘\b’
d) ‘\z’
View Answer

Answer: b
Explanation: MySQL provides the facility to use a wide range of escape sequences. They are special characters. They begin with the backslash character. For example, ‘\r’ specifies carriage return.
advertisement

10. What is the datatype for single precision floating point number?
a) FLOAT
b) DOUBLE
c) INT
d) BIGINT
View Answer

Answer: a
Explanation: There are various numeric datatypes in MySQL. Some of them are TINYINT, SMALLINT, BIGINT, FLOAT, DOUBLE and BIT. ‘FLOAT’ is for single precision floating point numbers unlike DOUBLE.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL for tests, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.