Suppose you are given a relation grade points(grade, points), which provides a conversion from letter grades in the takes relation to numeric scores; for example an "A" grade could be specified to correspond to 4 points, an "A-" to 3.7 points, a "B+" to 3.3 points, a "B" to 3 points, and so on. The grade points earned by a student for a course offering (section) is defined as the number of credits for the course multiplied by the numeric points for the grade that the student received.
Given the above relation, and our university schema, write each of the following queries in SQL. You can assume for simplicity that no takes tuple has the null value for grade.
a. Find the total grade-points earned by the student with ID 12345, across all courses taken by the student.
b. Find the grade-point average (GPA) for the above student, that is, the total grade-points divided by the total credits for the associated courses.
c. Find the ID and the grade-point average of every student.