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
Nginx uses regular expressions to automatically m...
Why do we say “usually 1em=16px”? The default tex...
1. Install cmake 1. Unzip the cmake compressed pa...
student.xml <?xml version="1.0" enco...
Authorization is to grant certain permissions to ...
The solution to the problem that mysql cannot be ...
I'm playing with big data recently. A friend ...
Table of contents What is index pushdown? The pri...
HTML img tag: defines an image to be introduced in...
Problem explanation: When using the CSS animation...
location / { index index.jsp; proxy_next_upstream...
1. Use CSS, jQuery, and Canvas to create animatio...
Preface How to write efficient SQL statements is ...
This article describes how to create multiple ins...
Recently, the Vue project needs to refresh the da...