
数据库的问题
student表:sno,snengscore表:sno,sscore,ssub首先对两个表输入数据,sno为学好,sneng为能力得分,sscore为成绩,ssub为科...
student表:sno,sneng
score表:sno,sscore,ssub
首先对两个表输入数据,sno为学好,sneng为能力得分,sscore为成绩,ssub为科目,student表sno为主码,第二个表(sno,ssub)为主码
第二个表中对同一个学生各科成绩计算平均值为智力得分,即avg(sscore) group by sno...
要求输入一个学生的学号,查询出该学生的名次,我用的是
select count(*) from student,score where (avg(score.sscore)*0.7+sneng*0.3)>(thisform.text2.value) and student.sno=student.sno into array qxpm
thisform.text5.value=qxpm
排名是根据总分排名,总分的计算方法是能力得分*0.3+智力得分*0.7
用的软件是vfp,avg这一块总是提示错误。。。。希望指教啊。。试了一个小时了。。。 展开
score表:sno,sscore,ssub
首先对两个表输入数据,sno为学好,sneng为能力得分,sscore为成绩,ssub为科目,student表sno为主码,第二个表(sno,ssub)为主码
第二个表中对同一个学生各科成绩计算平均值为智力得分,即avg(sscore) group by sno...
要求输入一个学生的学号,查询出该学生的名次,我用的是
select count(*) from student,score where (avg(score.sscore)*0.7+sneng*0.3)>(thisform.text2.value) and student.sno=student.sno into array qxpm
thisform.text5.value=qxpm
排名是根据总分排名,总分的计算方法是能力得分*0.3+智力得分*0.7
用的软件是vfp,avg这一块总是提示错误。。。。希望指教啊。。试了一个小时了。。。 展开
展开全部
没看明白中间那个SQL的意思。
盲写一段PL/SQL,希望有帮助
select count(tmp.sno) from (
select a.sno,sum(a.sneng) sumneng,avg(b.sscore) avgscore from student a,score b where a.sno = b.sno
group by a.sno
) tmp
where tmp.avgscore *0.7+tmp.sumneng*0.3 > select tmp1.avgscore *0.7+tmp1.sumneng*0.3 from (
select a.sno,sum(a.sneng) sumneng,avg(b.sscore) avgscore from student a,score b where a.sno = b.sno and a.sno='"学生的学号"'
group by a.sno) tmp1
盲写一段PL/SQL,希望有帮助
select count(tmp.sno) from (
select a.sno,sum(a.sneng) sumneng,avg(b.sscore) avgscore from student a,score b where a.sno = b.sno
group by a.sno
) tmp
where tmp.avgscore *0.7+tmp.sumneng*0.3 > select tmp1.avgscore *0.7+tmp1.sumneng*0.3 from (
select a.sno,sum(a.sneng) sumneng,avg(b.sscore) avgscore from student a,score b where a.sno = b.sno and a.sno='"学生的学号"'
group by a.sno) tmp1
展开全部
你用avg函数是,没有分组,所以有错误
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
建议发到 CSDN 论坛的数据库板块找人看看
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
二位二万人
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询