MySQL Questions and Answers – MySQL Datatypes – 2

This set of MySQL Multiple Choice Questions & Answers (MCQs) focuses on “MySQL Datatypes – 2”.

1. What will happen if the data being loaded into a text column exceeds the maximum size of that type?
a) Extra memory will be allocated
b) Process terminate
c) Data will be truncated
d) Depend on the system
View Answer

Answer: c
Explanation: Mysql cannot allocate dynamic memory therefore if data exceeds the memory then extra data will be truncated.

2. Which data type is more suitable for storing “small notes” in Mysql?
a) Char
b) Varchar
c) Mediumtext
d) Longtext
View Answer

Answer: c
Explanation: None.

3. Which data type is more suitable for storing “documents” in Mysql?
a) Varchar
b) Longtext
c) Mediumtext
d) Either Varchar or Longtext
View Answer

Answer: b
Explanation: Longtext has largest range.
advertisement
advertisement

4. “Numeric Data” is used to store ____________
a) Whole numbers
b) Natural numbers
c) Rational numbers
d) Both Whole and Natural numbers
View Answer

Answer: d
Explanation: None.

5. Which Numeric Data type has the largest range?
a) Mediumint
b) Smallint
c) Int
d) Tinyint
View Answer

Answer: c
Explanation: None.

6. What will be the storage pattern for “float(4,2)” in Mysql?
a) Total of four digits, two to the left of decimal and two to the right of decimal
b) Total of six digits
c) Total of four digits, not distributed uniformly
d) None of the mentioned
View Answer

Answer: a
Explanation: As per standards.

7. Which among the following are the correct representation of “float(4,2)”?
a) 24.33
b) 124.4
c) 12.123
d) Both 24.33 and 124.4
View Answer

Answer: d
Explanation: Float(4,2) allowed at most 2 digit at right of the decimal and left of the decimal.
advertisement

8. Which among the following is the correct representation of “float(5,0)”?
a) 12345.123
b) 12345.1
c) 12345
d) 123.123
View Answer

Answer: c
Explanation: “float(5,0) says there should be total of five digit, in which no digit should be at the right of the decimal.

9. Which among the following is the correct representation of “float(1,1)”?
a) Total of 1 digit
b) Total of 2 digit
c) Total of 2 digit, one digit at right of the decimal, one digit at left of the decimal
d) None of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

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.

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.