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.
现在我想从每个semister的点数计算gpa并最终计算学生的cgpa 我有下表:
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;