Date type differences and uses MySQL has five date types: date, time, year, datetime, and timestamp.
Application scenarios:
Implementation:
Example application: MySQL script implementation use case `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Creation time', `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update time', `datalevel` tinyint(1) DEFAULT '1' COMMENT 'Has it been deleted (0 deleted/1 normal)', ALTER TABLE table_name ADD COLUMN create_time datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Creation time'; ALTER TABLE table_name ADD COLUMN update_time datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update time'; ALTER TABLE table_name ADD COLUMN datalevel tinyint(1) DEFAULT '1' COMMENT 'Has it been deleted (0 deleted/1 normal)'; MySQL creates a normal index ALTER TABLE projectfile ADD INDEX (fileuploadercode, projectid); Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Analysis of the project process in idea packaging and uploading to cloud service
>>: Analysis of the method of setting up scheduled tasks in mysql
A common problem encountered during the developme...
MySQL master-slave setup MySQL master-slave repli...
Table of contents What utilities does VueUse have...
Detailed explanation of tinyMCE usage initializat...
Table of contents Setting up a basic HTTP request...
Preface For a data-centric application, the quali...
Let’s take a look at the renderings first: XML/HT...
This article shares the specific code for JavaScr...
The key features of the InnoDB storage engine inc...
Table of contents 1. Initialize the map 2. Map Po...
<br />Original text: http://blog.rexsong.com...
To connect Node-red to the database (mysql), you ...
This article aims to clarify the relationship bet...
Table of contents Event-driven and publish-subscr...
Phenomenon When using Apache Spark 2.x, you may e...