create table STUDENT(id varchar(10) primary key, name nvarchar(20)not null,
gender nvarchar(1) default 'F', di nvarchar(20),riqi year);

create table CLASS(ban int primary key,name nvarchar(20)not null,
xihao int not null,ruxue datetime);

create table DEPARTMENT(xihao varchar(2) primary key,ximing nvarchar(20)not null);

insert into CLASS set ban =1,name ='软件',xihao =02,ruxue ='2000-10-11';
insert into CLASS set ban =2,name ='微电子',xihao =02,ruxue ='2001-8-10';

insert into STUDENT set id =101,name ='张三',gender ='男',di ='山东',riqi =1984;
insert into STUDENT set id =102,name ='钱四',gender ='女',di ='济南',riqi =1984;
insert into STUDENT set id =103,name ='王玲',gender ='女',di ='福建',riqi =1985;
insert into STUDENT set id =104,name ='李飞',gender ='男',di ='河北',riqi =1985;

insert into DEPARTMENT set xihao ='02',ximing ='计算机';
insert into DEPARTMENT set xihao ='03',ximing ='数学';
insert into DEPARTMENT set xihao ='04',ximing ='化学';

alter table STUDENT add unqiue index_Sname(name);
alter table CLASS add index sban(ban);