MySQL Questions and Answers – MySQL Data Types – 5

This set of MySQL Interview Questions and Answers for Experienced people focuses on “MySQL Data Types – 5”.

1. The maximum non zero value for FLOAT is ___________
a) 3.402823466E+38
b) 3.402823466E+37
c) 3.402823466E+39
d) 3.402823466E+35
View Answer

Answer: a
Explanation: In MySQL, each datatype has its own range. Data types give an idea of the kind of values and the ranges that a variable is allowed to store. The maximum non zero value for FLOAT is 3.402823466E+38.

2. The maximum non zero values for DOUBLE is ___________
a) ±1.7976931348623157E+307
b) ±1.7976931348623157E+308
c) ±1.7976931348623157E+306
d) ±1.7976931348623157E+305
View Answer

Answer: b
Explanation: In MySQL, all the datatypes have their own ranges. Data types give an idea of the kind of values and the ranges that a variable is allowed to store. The maximum non zero value for DOUBLE is ±1.7976931348623157E+308.

3. The storage size in bytes required for the MEDIUMINT datatype is ___________
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: The numeric datatypes used in MySQL vary over ranges. There are a variety of INT types in the type specification. TINYINT requires 1, SMALLINT requires 2 bytes and MEDIUMINT requires 3.
advertisement
advertisement

4. The size of the BIT type is ___________
a) 1
b) 2
c) 3
d) variable
View Answer

Answer: d
Explanation: All the numeric datatypes used in MySQL vary over the fields. However the maximum size is fixed. Unlike the other numeric types the size of the BIT datatype depends on the length of the field.

5. The REAL type is synonym for ___________
a) FLOAT
b) INT
c) DOUBLE
d) BIT
View Answer

Answer: c
Explanation: The REAL datatype, by default, is for the DOUBLE type. Floating point types can be defined as UNSIGNED. This eliminates the negative end of the type ranges. MySQL has a variety of default types.

6. The maximum number of elements allowed in SET() is ___________
a) 16
b) 32
c) 64
d) 128
View Answer

Answer: c
Explanation: The SET type specification is very useful for storing a collection a ordered and distinct elements. The storage size required for this datatype is variable and dependent on the cardinality.

7. The number of binary string types among the following is ___________

BINARY, VARBINARY, BLOB, CHAR
advertisement

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

Answer: c
Explanation: In MySQL, the string datatypes are broadly categorised into two, namely, binary string types and non binary string types. BINARY, VARBINARY and BLOB are the binary string datatypes.

8. The maximum size in bytes of a row in MySQL is __________
a) 65534
b) 65535
c) 65536
d) 65537
View Answer

Answer: b
Explanation: The allowable range of M for VARCHAR(M) syntactically is 1 to 65535, but the effective number of the maximum characters is less than 65535 since MySQL has a maximum row size of 65,535 bytes.
advertisement

9. MEMORY tables do not support BLOB and TEXT indexes.
a) True
b) False
View Answer

Answer: a
Explanation: BLOB or TEXT columns sometimes can be indexed, depending on the storage engine. MEMORY tables do not support BLOB and TEXT indexes. The MEMORY engine does not support BLOB or TEXT.

10. MySQL works with spatial values in 3 formats.
a) True
b) False
View Answer

Answer: a
Explanation: MySQL works with the spatial values in three formats. They are the internal format, the Well-Known Text (WKT) and the Well-Known Binary(WKB) formats for the spatial datatypes.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL for Interviews, 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.