处理表
1.
alter table student modify Sage smallint;
2.
mysql> desc course;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| Cno | int | NO | PRI | NULL | |
| Cname | varchar(20) | NO | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> alter table course add index index_Cno(Cno);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show create table course\G
*************************** 1. row ***************************
Table: course
Create Table: CREATE TABLE `course` (
`Cno` int NOT NULL,
`Cname` varchar(20) NOT NULL,
3.
create index SC_INDEX on sc(sno,cno asc);
4.
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 索引名 on 表名