Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Beginner help

958026Aug 26 2012 — edited Oct 29 2012
I am trying to learn more with writing pl SQL. What is the best way to be able to look at existing pl SQL queries and figure out what the output would be for beginners? For example, I pasted one below. I get the gist of it, but could someone explain more why it is doing and is there a better way it could be writen?


select spriden_id id, spriden_last_name lname, spriden_first_name fname,
sgbstdn_styp_code stype, shrttrm_astd_code_end_of_term astd,
shrtgpa_hours_attempted attempt, shrtgpa_quality_points qpoints, shrtgpa_gpa gpa
from shrttrm
join spriden
on spriden_pidm = shrttrm_pidm
join sgbstdn
on sgbstdn_pidm = shrttrm_pidm
and sgbstdn_term_code_eff = shrttrm_term_code
join shrtgpa
on shrtgpa_pidm = shrttrm_pidm
where shrttrm_term_code = '201140'
and spriden_change_ind is null
and (shrttrm_astd_code_end_of_term is null or
     shrttrm_astd_code_end_of_term = '00' or
     shrttrm_astd_code_end_of_term is null)
and sgbstdn_styp_code in ('C', 'R')
and shrtgpa_term_code = '201140'
and shrtgpa_gpa_type_ind = 'I'
order by shrtgpa_gpa, shrtgpa_quality_points
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2012
Added on Aug 26 2012
5 comments
348 views