这段时间看了好多东西却没有总结,今天在这里写一写 关于索引 索引是一种提高查询效率的方法,它是B+树的结构,从根到中间节点在到叶子节点,无需遍历全部就可以查到所需的东西 关于索引的创建 一般有俩种方式 在创建table的时候添加索引 create table test( id int not null, index i_sss(id); 在已有的table中添加索引 create index i_sss(id) on test; 如何查看索引 show index from test; 如何删除…
1.插入数据: insert into t1(id,name) values(1,'alex'); #向t1表中插入id为1,name为'alex'的一条数据 2.删除: delete from t1 where id<6; #删除t1表中id<6的数据 3.修改: update t1 set age=18; #把t1表中数据的age字段全部改成18 update t1 set age=18 where age=17; #把t1表中的age=17的全部字段改成18 4.查看数据: select…
1.数据库的操作 create database 数据库名:#一般创建方式 create database 数据库名 show databases;#查看所有数据 drop database 数据库名:#删除数据库 use 数据库名:#进入数据 2.表的操作 show tables;#查看所有的表 create table t1( id int,#列名 数据类型 name ),#列名 数据类型 );#创建表 create table t1( id ) ) default charset=utf8…