What is the difference between timestamp and datetime in mysql?
Answer / Ruchi Deva
Both TIMESTAMP and DATETIME are used to store date and time values, but there are some differences:
1. Precision: A TIMESTAMP column can store time up to microseconds (precision up to 6), while a DATETIME column can store time up to fractional seconds (precision up to 3).
2. Default Value: If no value is specified, the default value for a TIMESTAMP column is the current date and time, while for a DATETIME column it's '0000-00-00 00:00:00'.
3. Storage Requirement: A TIMESTAMP column takes less storage space than a DATETIME column.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the maximum connection pool size?
What is difference between oracle sql and mysql?
Can mysql scale horizontally?
What are mysql queries?
How to create a trigger in mysql?
How do I install the latest mysql on ubuntu?
What's new in mysql 8?
What is the phantom problem?
What are the types of queries?
about join
How do I edit a table in mysql workbench?
date funciton
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)