Mysql (Mariadb) basic operation statement (continuous update), mysqlmariadb
Basic SQL statements for reference. (Executed in HeiDiSql)
# Create Database If Not Exists VerifyIdear Character Set UTF8; # Create Table If Not Exists VerifyIdear. myTable (ID Bigint (8) unsigned Primary key Auto_Increment, Updatetime DateTime, name VarChar (128) Engine = MyISAM; # Switch to the specified database use verifyidear; # specify the table to add the field alter table MyTable add column If Not Exists adcolumn varchar (64) default ''; # Delete the field alter table MyTable drop column If Exists adcolumn;
# Add the alter table mytable comment 'test table' comment '; # modify the field name, type, default value, field sorting rule, comment, and field location alter table 'mytable' change column 'name' VARCHAR (128) default null collate 'utf8 _ general_ci 'comment' username 'after'thtime '; # modify Field Type, default value, sorting rule, comment, field location alter table mytable modify column name varchar (128) default null collate 'utf8 _ general_ci 'comment' username 'after thtime;