7、视图管理语句
创建视图
#首先确认是否有权限
>select create_view_priv,select_priv from mysql.user where user='root' and host='192.168.3.%';
#创建一个简单的视图
> create view testvi as select * from classes where classid <= 3;
> create or replace view testvi as select * from classes where classid <= 4;
删除视图
> drop view testvi;
> drop view if exists testvi;
查看视图
#查看数据库中的所有视图
> select * from information_schema.views where table_schema='U_DB_NAME';
#查看视图结构
>desc testvi
修改视图
> alter view testvi as select name,age,gender from students;