declare
cursor c1 is select Student.sno,sname,grade from Student,SC where SC.sno=Student.sno and sdept='CS' and cno in(select cno from Course where cname='数学') group by Student.sno,sname,grade order by Student.sno;
begin
dbms_output.put_line(rpad('学号',10,' ')||rpad('姓名',10,' ')||rpad('成绩',10,' '));
dbms_output.put_line('-------------------------');for i in c1 loop
dbms_output.put_line(rpad(i.sno,10,' ')||rpad(i.sname,10,' ')||rpad(i.grade,10,' '));
end loop;
end;