视图 索引 存储过程

                                                                                             视图

创建视图:create  view  视图名称 select 字段名称 from 表一 inner join 表二 on 表一.字段=表二.字段 或where 条件

视图的使用: select * from 视图名称

 

                                                             索引

创建索引:在mysql中创建索引:alter table 表名称 add index 索引名(也就是所要用作的索引的字段)。

                             alter  table 表名称 add unique 索引名(也就是所要用作索引的列名)。 unique 表示唯一

                             alter  table 表名称 add primary key 索引名(也就是要用作索引的列名)。 primary key 主键。

                                                  

                                                                存储过程

创建存储过程:create or replace procedure 存储过程名(参数 参数类别 参数2 参数列别2)as

变量名1  变量类型1

变量名2  变量类型2

begin

null

end

 

posted on 2016-12-16 08:50  晨哥  阅读(415)  评论(0编辑  收藏  举报

导航