1.create table test4_01 as
(
select *
from pub.STUDENT_41)
alter table test4_01 add sum_score
create table test41 as
(select sum(score) sumscore,sid
from pub.STUDENT_COURSE
group by sid)
update test4_01
set sum_score=(
select sumscore
from test41
where test41.sid=test4_01.sid)
2.create table test4_02
as(select *
from pub.STUDENT_41)
create table test42 as
(select sid,avg(score) avgscore
from pub.STUDENT_COURSE
group by sid)
alter table test4_02 add avg_score numeric(4,1)
update test4_02
set avg_score=(
select avgscore
from test42
where test42.sid=test4_02.sid)
3.create table test4_03 as
(select *
from pub.STUDENT_41)
alter table test4_03 add sum_credit int
create table test43 as
(select sum(credit) sumcredit,sid
(
select *
from pub.STUDENT_41)
alter table test4_01 add sum_score
create table test41 as
(select sum(score) sumscore,sid
from pub.STUDENT_COURSE
group by sid)
update test4_01
set sum_score=(
select sumscore
from test41
where test41.sid=test4_01.sid)
2.create table test4_02
as(select *
from pub.STUDENT_41)
create table test42 as
(select sid,avg(score) avgscore
from pub.STUDENT_COURSE
group by sid)
alter table test4_02 add avg_score numeric(4,1)
update test4_02
set avg_score=(
select avgscore
from test42
where test42.sid=test4_02.sid)
3.create table test4_03 as
(select *
from pub.STUDENT_41)
alter table test4_03 add sum_credit int
create table test43 as
(select sum(credit) sumcredit,sid