250+ TOP MCQs on MySQL Data Types and Answers

Tough MySQL Interview Questions & Answers focuses on “MySQL Data Types”.

1. The datatype for single precision floating point number is ____________
a) FLOAT
b) DOUBLE
c) INT
d) BIGINT

Answer: a
Clarification: 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.

2. Which datatype is used for a fixed length binary string?
a) VARCHAR
b) BINARY
c) VARBINARY
d) BLOB

Answer: b
Clarification: MySQL has a variety of string datatypes for use. Strings can hold arbitrary binary data. All the four options are string type names. BINARY is used for a fixed length binary string.

3. Which datatype means a variable length non binary string?
a) VARCHAR
b) BINARY
c) VARBINARY
d) BLOB

Answer: a
Clarification: In MySQL, there are a wide variety of string datatypes for use. Strings can even hold image and sound data. All the four options are string type names. VARCHAR represents a variable length non binary string.

4. Which data and time datatype stores time value in ‘hh:mm:ss’ format?
a) DATE
b) TIME
c) DATETIME
d) TIMESTAMP

Answer: b
Clarification: MySQL has some variety of date and time datatypes. These datatypes are crucial for representing records in a table. The ‘TIME’ type represents a time value, stored in the ‘hh:mm:ss’ format.

5. Which spatial datatype is used to store a curve?
a) GEOMETRY
b) POINT
c) LINESTRING
d) POLYGON

Answer: c
Clarification: In MySQL, there are many spatial datatypes available for use. Some examples are GEOMETRY, POINT, LINESTRING and POLYGON. The LINESTRING type is used to represent a curve.

  250+ TOP MCQs on Populating & Modifying Tables and Answers

6. How many of the following attributes are allowed only for numeric types?

UNSIGNED, ZEROFILL, CHARACTER SET, COLLATE

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

Answer: b
Clarification: UNSIGNED and ZEROFILL are allowable only for numeric types, and CHARACTER SET and COLLATE are allowable only for non-binary string types. These are type specific attributes.

7. A DEFAULT value cannot be supplied to spatial types.
a) True
b) False

Answer: a
Clarification: For every data type except the BLOB and TEXT types, spatial types, or columns with the AUTO_INCREMENT attribute, a DEFAULT def_value clause can be specified to keep a default value for a column.

8. A DEFAULT value cannot be supplied to TEXT types.
a) True
b) False

Answer: a
Clarification: The DEFAULT def_value clause can be specified for every data type except the BLOB and TEXT types, spatial types, or columns with the AUTO_INCREMENT attribute. The def_value holds the default.

9. The datatype INT stores ___________
a) 16 bit
b) 32 bit
c) 48 bit
d) 64 bit

Answer: b
Clarification: Numeric datatypes in MySQL are many. Each numeric datatype used in MySQL have their own ranges in terms of bits. The INT datatype stores signed and unsigned values of 32 bits.

10. The datatype SMALLINT stores ___________
a) 16 bit
b) 32 bit
c) 48 bit
d) 8 bit

Answer: a
Clarification: In MySQL, the numeric datatypes are many. A numeric datatype used in MySQL has its own range in terms of bits. The SMALLINT datatype stores signed and unsigned values of 16 bits.

Leave a Comment

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

Scroll to Top