1、创建测试表,
create table test_score(id varchar2(20),sid varchar2(20), score number(10));
2、插入测试数据;
insert into test_score values(1,1,100);
insert into test_score values(2,1,80);
insert into test_score values(3,2,85);
insert into test_score values(4,2,60);
insert into test_score values(5,3,82);
insert into test_score values(6,3,89);
insert into test_score values(7,2,0);
commit;
3、查询表中全量数据;select t.*, rowid from test_score t;
4、编写语句,查询出平均成绩大于60分的同学的学号和平均成绩;
select sid, avg(score) avg from test_score t group by sid having avg(score)>60