按要求创建表:
1.修改student 表中年龄(sage)字段属性,数据类型由int 改变为smallint
alter table student modify sage smallint;
2.为Course表中Cno 课程号字段设置索引,并查看索引
create index index_cno on course (cno);
show index from course\G
3.为SC表建立按学号(sno)和课程号(cno)组合的升序的主键索引,索引名为SC_INDEX
create index sc_index on sc (sno asc,cno asc);
4.创建一视图 stu_info,查询全体学生的姓名,性别,课程名,成绩
create view stu_info as select sname,ssex,cname,score from student join sc on student.sno=sc.sno join course on sc.cno=course.cno;
5.删除所有索引
drop index index_cno on course;
drop sc_index on sc;