jiony 2020-06-08
增:create database db1 charset utf8; 查:show databases; 改:alter database db1 charset latin1; 删除: drop database db1;
先切换到表中:use db1 增:create table t1(id int,name char); 查:show tables; 改:alter table t1 modify name char(3); alter table t1 change name name1 char(2); 删:drop table t1;
增:insert into t1 values(1,‘egon1‘),(2,‘egon2‘),(3,‘egon3‘); 查:select * from t1; 改:update t1 set name=‘sb‘ where id=2; 删:delete from t1 where id=1;
delete from t1; #如果有自增id,新增的数据,仍然是以删除前的最后一样作为起始。 truncate table t1;数据量大,删除速度比上一条快,且直接从零开始,