索引,视图

1 :create table table_name(.... [unique|fulltext|spatial]  index|key 别名(属性名[(长度)]) [asc|desc]);

2:在已存在的表上创建索引:create [unique | fulltext | spatial ]  index 索引名 on 表明名(属性名[(长度) ][ asc | desc ])

3:使用alter table 语句创建表名:

            alter table 表名 add  [ unique | fulltext | spatial ]  index  索引名 (属性名 [(长度)] [asc | desc ])

4:删除索引:

            drop index 索引名 on 表名;

5:视图定义

            视图是从数据库中的一个表或者多个表导出来的虚拟表,视图还可以从已经导出来的试图定义。数据库中只是存储了视图的定义,并没有另外存储数据,当使用视图查询时,数据库会从原来的表中取出数据。因此一旦数据库中的数据发生改变,那么视图中的数据也会发生改变。

你可能感兴趣的:(索引,视图)