I do have the following code.
SQL> select * from student_gpa;
SSN GPA
--------------- ----------
22222
First 30 percent with 2 selects:
select ssn,gpa from(
select ssn, gpa,rank() over (order by gpa asc) as rn, count(*) over() as cnt
from student_gpa
)
where rn < 0.3*cnt ;
Solution with 4 selects and rownum (very ugly):
select ssn,gpa from(
select ssn, gpa
from student_gpa
)
where rownum < 0.3*(select count(*) from (select ssn, gpa from student_gpa));