数据库---视图和索引

根据学生表students建立一个女生表,包含所有信息。

create table girl  as select * from students where sex=“女”;

视图操作:

建立一个只包括教师号,姓名和年龄的视图faculty(视图定义中不可以使用order by语句)

createn view faculty  as select tno,tname,age from teachers;

删除视图:drop view  faculty  restrict;

索引操作:

在学生表中按学号创建索引

create unique index st on stundets(sno);

删除按学号所创建的索引

drop index st on students;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

在学生表中查出籍贯是空的学生信息

select * from students where bplace is null;

原文地址:https://www.cnblogs.com/zhouzetian/p/7477419.html