如何找到学生的cgpa [英] How to find cgpa of a student

查看:192
本文介绍了如何找到学生的cgpa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i am trying to create the cgpa for students from my result table.
       i have the result table where i have the points and grade of each course of a student in a semister.
   now i am trying to calculate the gpa from the points of each semister and finally calculating the cgpa of the student




now how can i calculate the gpa of each term of student.and then the cgpa..help please
thanks in advance..
gpa formula:
gpa=summation of ((credit*points) of each course) divided by total credit in a semister;





我尝试了什么:



i我正试图从我的结果表中为学生创建cgpa。

i有以下内容表:



创建表格结果(

id number(2),

roll number(10),

c_id varchar(30),

标记数字(6,2),

年份数字(3),

学期编号(3),

学分整数CHECK(学分> 0和学分< 5),

poi nts number(3,2),

grade varchar(4)

);



ALTER TABLE结果添加外键(滚动)REFERENCES学生(roll)

ALTER TABLE结果添加外键(c_id)参考课程(c_id)



i有插入学生的两个学期的结果。



插入结果(id,roll,c_id,mark,year,term,credit,points,grade)value( 1,1307001,'cse 3103',200,2,1,3,4,'A +');

插入结果(id,roll,c_id,mark,year,term,credit,积分,等级)值(2,1307001,'cse 3105',200,2,1,3,3.5,'A');

插入结果(id,roll,c_id,marks,年,期限,信用,积分,等级)值(3,1307001,'cse 3109',200,2,1,4,3.25,'B +');



插入结果(id,roll,c_id,mark,year,term,credit,points,grade)值(1,1307001,'cse 3103',200,3,1,4,3.5,'A');

插入结果(id,roll,c_id,标记,年份,期限,信用,积分,等级)值(2,1307001,'cse 3103',200, 3,1,3,3.25,'B +');

插入结果(id,roll,c_id,标记,年份,期限,信用,积分,等级)值(3,1307001,' cse 3103',200,3,1,3,3.00,'B');



现在我如何计算每学期学生的gpa。然后cgpa..help请

提前感谢..

gpa公式:

gpa =每个((信用*积分)的总和当然)除以semister中的总积分;



What I have tried:

i am trying to create the cgpa for students from my result table.
i have the following table:

create table result(
id number(2),
roll number(10),
c_id varchar(30),
marks number (6,2),
year number(3),
term number(3),
credit integer CHECK(credit>0 and credit<5),
points number(3,2),
grade varchar (4)
);

ALTER TABLE result ADD FOREIGN KEY (roll) REFERENCES student(roll)
ALTER TABLE result ADD FOREIGN KEY (c_id) REFERENCES courses(c_id)

i have inserted the result of two terms of a student.

insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (1,1307001,'cse 3103',200,2,1,3,4,'A+');
insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (2,1307001,'cse 3105',200,2,1,3,3.5,'A');
insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (3,1307001,'cse 3109',200,2,1,4,3.25,'B+');

insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (1,1307001,'cse 3103',200,3,1,4,3.5,'A');
insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (2,1307001,'cse 3103',200,3,1,3,3.25,'B+');
insert into result (id,roll,c_id,marks,year,term,credit,points,grade) values (3,1307001,'cse 3103',200,3,1,3,3.00,'B');

now how can i calculate the gpa of each term of student.and then the cgpa..help please
thanks in advance..
gpa formula:
gpa=summation of ((credit*points) of each course) divided by total credit in a semister;

推荐答案

我认为你的设计有问题。

请参阅下面的代码。你需要写这样的东西。



SELECT roll,c_id,(SUM(信用*积分))/(SUM(信用卡))

FROM result

Group BY roll,c_id
I think your design is having some problem.
Please see the below code. U need to write something like this.

SELECT roll, c_id , (SUM(credit*Points))/(SUM(credit))
FROM result
Group BY roll, c_id


这篇关于如何找到学生的cgpa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆