
1、建库建表


1.学生表student,定义主键,姓名不能重名,性别只能输入男或女,所在系的默认值是"计算机",结构如下:student(Sno 学号,Sname姓名,ssex性别,Sage 年龄,sdept 所在系)Sno为主键
2.用SQL语句创建课程表
course(cno 课程号,Cname 课程名)sno,cno为主键

3.用SQL语句创建选课表
sC(sno 学号,cno 课程号,score 成绩)Sno,cno为主键

2、处理表
1.修改student 表中年龄(sage)字段属性,数据类型由int 改变为smallint

2.为Course表中Cno 课程号字段设置索引,并查看索引

3.为SC表建立按学号(sno)和课程号(cno)组合的升序的主键索引,索引名为SC_INDEX

4.创建一视图 stu info,查询全体学生的姓名,性别,课程名,成绩

5.删除所有索引
