学生表:mysql> create table student(
-> sno int primary key,
-> sname varchar(50),
-> ssex enum("男","女"),
-> sage int,
-> sdept varchar(50) default "计算机"
-> );
课程表:mysql> create table course(
-> cno int primary key,
-> cname varchar(100)
-> );
选课表:mysql> create table sc(
-> sno int,
-> cno int,
-> score int,
-> primary key (sno,cno),
-> foreign key(sno) references student(sno),
-> foreign key(cno) references course(cno)
-> );
mysql> alter table student modify column sage smallint;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0