CREATE INDEX语句用于在表中创建索引,在不读取整个表的情况下,索引使数据库应用程序可以更快地查询数据
create index index_name on tb_name (c_name)
create index in_id on tb1 (id)
CREATE UNIQUE INDEX 创建唯一的索引
create unique index index_name on tb1 (id)
create unique index index_name on tb1 (id ,name)--多个列
CREATE VIEWS 创建视图,视图是基于SQL语句结果集的可视化的表。视图中的字段就是来自一个或多个数据库中的真实的表中的字段。
create view view_name as select * from tb1 where id>0 --视图总是显示最新的数据
drop view view_name 删除视图