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
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
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
Explanation: Default means values that are assumed by the server.
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
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
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
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
Explanation: “Timestamp” column will automatically be populated with current Date/time by the Mysql server, when any row modified.
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
Explanation: “Float(4,2)” cannot store more than 4 digits.
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.
- Practice Programming MCQs
- Apply for Programming Internship
- Check Information Technology Books
- Check MySQL Books