刚学数据库,纯新手,用的oracle,有道题不会呀!求解!!!

Supposeyouaregivenarelationgradepoints(grade,points),whichprovidesaconversionfromlett... 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.
求详细讲解呀!!!不要只给答案
展开
 我来答
nietiezheng
2013-10-14 · TA获得超过5536个赞
知道大有可为答主
回答量:3132
采纳率:87%
帮助的人:1237万
展开全部
you do not give the university schema which includes the relations of courses and courses selected by students. I don't know the number of credits and the student ID in which relation.

Suppose there exists two relations:
Students-course(SID, CID, grade)
course(CID, credit)
a: use a join operation
select sum(GP.points*C.credit) as GP
from Students-course SC, grade-points GP, course C
where SC.SID='12345' and SC.grade=GP.grade and SC.CID=C.CID
b: It need two aggragation operations
select sum(GP.points*C.credit)/sum(C.credit) as GPA
from Students-course SC, grade-points GP, course C
where SC.SID='12345' and SC.grade=GP.grade and SC.CID=C.CID
c: It need a group operaton and two aggragation operations
select SID, sum(GP.points*C.credit)/sum(C.credit) as GPA
from Students-course SC, grade-points GP, course C
where SC.grade=GP.grade and SC.CID=C.CID
group by SID
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
ZESTRON
2024-09-04 广告
表面污染分析包括评估表面上存在的颗粒、残留物或物质。通过利用显微镜、光谱学和色谱法等技术,分析人员可以识别和表征污染物,以确定其成分和来源。这种分析在电子、制药和制造等各个行业中至关重要,以确保产品质量、性能和安全性。了解表面污染有助于实施... 点击进入详情页
本回答由ZESTRON提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式