考,管它是库是表,设计思路都一样,体现个人思想罢了,太简单了吧,给你两条语句:
当学生输入学号xh,密码pwd时,通过检测学生表(student)看是否存在学生,如果存在,连接成绩(score)表查询出成绩.
if EXISTS(select xh,xm from student where xh=@xh and pwd=@pwd )................
....
成功后
select student.xh,student.xm,score.kcmc,score.cj from student right outer jion score on score.xh=student.xh where student.xh=@xh