MySQL Questions and Answers – Numeric Data Types

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Numeric Data Types”.

1. Which of these is not an exact numeric type?
a) SMALLINT
b) DECIMAL
c) NUMERIC
d) REAL
View Answer

Answer: d
Explanation: MySQL supports all the standard SQL numeric data types. These are the exact numeric data types like INTEGER, SMALLINT, DECIMAL and NUMERIC and the approximate numeric data types like FLOAT, REAL and DOUBLE PRECISION.

2. How many of the following do not support ‘BIT’ data type?

MyISAM, MEMORY, NDB

a) 0
b) 1
c) 2
d) 3
View Answer

Answer: a
Explanation: The BIT data type stores the bit values. It is supported for the MyISAM, MEMORY, InnoDB and NDB tables. MySQL supports all the standard SQL numeric data types, both the exact and approximate.
advertisement
advertisement

3. The statement that suspends the replication related activity of the slave server is _____________
a) RESUME SLAVE
b) START SLAVE
c) STOP SLAVE
d) GET SLAVE
View Answer

Answer: c
Explanation: The ‘STOP SLAVE’ and ‘START SLAVE’ statements suspend and resume the replication-related activity of a slave server. These statements are useful for telling the slave to be quiescent.

4. The minimum value stored by signed TINYINT is _____________
a) -256
b) -128
c) 0
d) 128
View Answer

Answer: b
Explanation: MySQL supports the SQL standard integer types INTEGER, or INT, and SMALLINT. As an extension to this standard, MySQL also supports the integer types TINYINT, MEDIUMINT and BIGINT.

5. MySQL uses security based on ACL. What does it stand for?
a) Access Control Language
b) Access Control Lists
c) Automatic Control Lists
d) Automatic Control Language
View Answer

Answer: b
Explanation: MySQL uses security based on Access Control Lists (ACLs) for all connections, queries and other operations that users can attempt to perform. There is support for SSL encrypted connections.

6. On Unix, ‘mysql’ client writes a record of executed statements to a history file.
a) True
b) False
View Answer

Answer: a
Explanation: On Unix the mysql client writes a record of the executed statements to a history file. By default, this file is named as ‘.mysql_history’. It is created in the home directory.
advertisement

7. A password applies locally to an account.
a) True
b) False
View Answer

Answer: b
Explanation: In the MySQL privilege system, a password applies globally to an account. A password cannot be explicitly associated with a specific object such as a database, table, or routine.

8. If $a represents an array with numeric indices in PHP, the first element accessed by ______________
a) $a[1]
b) $a[0]
c) $a.1
d) $a.0
View Answer

Answer: b
Explanation: If $a represents an array with numeric indices, its elements are accessed as $x[0], $x[1], and so on. In general terms, each element at the position i is accessed and used as $a[i – 1].
advertisement

9. The operator used in PHP to access property of an object is ________________
a) .
b) *
c) ->
d) @
View Answer

Answer: c
Explanation: If $a represents an object, the properties it has can be accessed as $a->property-name. For instance, $a->white, $a->black, $a->blue, $a->red can be the properties of $a and accessed in this way.

Sanfoundry Global Education & Learning Series – MySQL Database.

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

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.