这里我是用mysql实现的
学生(学号,姓名,性别,专业,出生年月)
教师(教师编号,姓名,所在部门,职称)
授课(教师编号,学号,课程编号,课程名称,教材,学分,成绩)
student(stu_no,stu_name,stu_sex,stu_department,stu_birth)
teacher(tea_no,tea_name,tea_department,tea_level)
class(cls_teano,cls_stuno,cls_no,cls_name,cls_material,cls_credit,cls_grade.)
1
select 职称,所在部门
from 教师
where 姓名='李洪'
2
select 教师.职称,教师.所在部门,授课.课程
from 教师,授课
where 教师.姓名='李洪' and 教师.教师编号=授课.教师编号
3
select 学生.姓名 as 姓名,授课.课程名称 as 课程,
(case when 授课.成绩<60 then 60 else 授课.成绩 end) as 成绩
from 授课,教师,学生
where
教师.姓名='李洪' and 教师.教师编号=授课.教师编号
and 学生.编号=授课.学生编号
order by '成绩' desc
4
insert into 学生(学号,姓名,性别,专业,出生年月)
values
('0099','LK','MALE','english','1975/12/12')
##################################################
select student.stu_name as '姓名',class.cls_name as '课程',(case when class.cls_grade<60 then 60 else class.cls_grade end)as '成绩'
from class,teacher,student
where
teacher.tea_name='李洪' and teacher.tea_no=class.cls_teano
and student.stu_no=class.cls_stuno
order by '成绩' asc
##################################################
select student.stu_name as '姓名',class.cls_name as '课程',class.cls_grade as '成绩'
from class,teacher,student
where
teacher.tea_name='李洪' and teacher.tea_no=class.cls_teano
and student.stu_no=class.cls_stuno
order by '成绩' asc
////////////////////////////
TIME:17:00 2006-9-28
mysql
评论