MySQL Questions and Answers – MySQL Datatypes – 3

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

1. Which data type is used to store data and time in Mysql?
a) Numeric data type
b) Text data type
c) Temporal data type
d) Char/Varchar
View Answer

Answer: c
Explanation: Temporal data are used for storing Date, Time, TimeStamp or Datetime.

2. What is the default format for “Date” data type?
a) YYYY-MM-DD
b) MM-YYYY-DD
c) DD-MM-YYYY
d) None of the mentioned
View Answer

Answer: a
Explanation: Default means values that are assumed by the server.

3. What is the default format for “Datetime” data type?
a) YYYY-MM-DD HH:MI:SS
b) MM-YYYY-DD HH:MI:SS
c) DD-YYYY-MM MI:HH:SS
d) None of the mentioned
View Answer

Answer: a
Explanation: Default means values that are assumed by the server.
advertisement
advertisement

4. What is the default format for “Timestamp” data type?
a) YYYY-MM-DD HH:MI:SS
b) MM-YYYY-DD HH:MI:SS
c) DD-YYYY-MM MI:HH:SS
d) None of the mentioned
View Answer

Answer: a
Explanation: Default means values that are assumed by the server.

5. What is the default format for “Year” data type?
a) YYYY
b) YYYY-DD-MM
c) MM-YYYY-DD
d) None of the mentioned
View Answer

Answer: a
Explanation: Default means values that are assumed by the server.

6. What is the default format for “Time” data type?
a) HHH:MI:SS
b) SS:MI:HHH
c) MI:SS:HHH
d) None of the mentioned
View Answer

Answer: a
Explanation: Default means values that are assumed by the server.

7. Is “Datetime” and “Timestamp” are same data type?
a) Yes
b) No
c) Depends
d) None of the mentioned
View Answer

Answer: a
Explanation: “Timestamp” column will automatically be populated with current Date/time by the Mysql server, when any row modified.

advertisement

8. Which value will show an error when stored in float(4,2)?
a) 12.11
b) 13.1
c) 1.12
d) 123.44
View Answer

Answer: d
Explanation: “Float(4,2)” cannot store more than 4 digits.

Sanfoundry Global Education & Learning Series – MySQL Database.

advertisement

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.