Presentation is loading. Please wait.

Presentation is loading. Please wait.

USING Sql to make banner better

Similar presentations


Presentation on theme: "USING Sql to make banner better"— Presentation transcript:

1 USING Sql to make banner better
Dustin McDaniel Athens Technical College

2 If you are using POP SELS
Select From Where

3 YOU are ALREADY using SQL
Select From Where

4 There is a big difference in the output

5 Basic tips Keep reports short and simple at first. The longer and more complex a query is, the harder it is to get everything to behave and/or track down problems. We’ll talk about making more complex reports in a bit. Be aware of school differences in how things are coded. Borrowing a report from a friend can be a great way to start but don’t expect it to work without some tweaking. Avoid writing new reports during times when Banner is under stress (registration, etc.). This is the one time you can break something using SQL Developer. If Banner is already overloaded and you run a bad script, you can crash Banner.

6 The green “play” button runs the report
If you report runs for more than 8 or 10 seconds, it’s likely that you have left something out and your Banner database is running at 100%. Click the red X circle to immediately kill the report.

7 Select tips Commas! You need one after each field you’re selecting
Several helpful functions such as SUM() and COUNT(). These require a GROUP BY line in the WHERE section (more on this later). Are you getting duplicates in your output? Adding DISTINCT after SELECT can help weed out duplicates. Is there something missing or incorrect in your WHERE section? (Term, Aid Year, etc.) Leaving a column out is a last resort but it will easily get rid of duplicate lines. Missing a column in your output? You probably missed a comma after a SELECT field

8 from tips This is your list of tables used in your SQL statement. It must include all tables under the SELECT and WHERE keywords. Don’t include tables you don’t need. At best, this will slow down your script. At worst, it will cause it not to work.

9 WHERE tips This is where you define your criteria for your report
Joining tables All tables have to be joined by the PIDM or other common element. Pop sels do this automatically behind the scenes. spriden_pidm = sfrstca_pidm AND spriden_pidm = rorenrl_pidm AND spriden_pidm = rpratrm_pidm AND If you are using spriden in your script, you always need “spriden_change_ind is null” in your WHERE section. This will pull the current ID (the student ID number rather than SSN). GROUP BY requires to list all of the fields you’re using in SELECT except the one you’re grouping by Know how Banner works. Does this table have a current record indicator, aid year, sequence number

10 Commonly used tables SPRIDEN – student ID and name
SGBSTDN – major code SFRSTCR – registration RORENRL – FA hours RPRATRM – term level FA RORSTAT – verification info SHRLGPA – cumulative GPA/hours TBRACCD – student account DESC Table This will give you a list of all fields in a table

11 Subqueries where sgbstdn_term_code_eff =
(select max(sgbstdn_term_code_eff) from sgbstdn where sgbstdn_pidm = spriden_pidm and sgbstdn_term_code_eff <= '&&term_code')

12 Joining tables on things besides pidm
where ssbsect_crn = sfrstcr_crn and ssbsect_term_code = sfrstcr_term_code and spriden_change_ind is null and spriden_pidm = rcrapp1_pidm and spriden_pidm = rcrapp3_pidm and rcrapp1_aidy_code = 1516 and rcrapp3_aidy_code = rcrapp1_aidy_code and rcrapp1_curr_rec_ind ='Y' and rcrapp1_seq_no = rcrapp3_seq_no and

13 MINUS, INTERSECT, and UNION
In my opinion, these functions are the most powerful thing you will use in pop sels and SQL. It’s almost always better to create two simple scripts to do the job of one complicated one. Example: You can create a script to find students who made all F’s in a term by taking students who had at least one F and using the MINUS function to remove students who had a grade that was not an F

14 Example ( select spriden_id, spriden_first_name, spriden_last_name
from spriden, SHRTCKG, RPRATRM where spriden_pidm = SHRTCKG_pidm and spriden_pidm = RPRATRM_pidm and spriden_change_ind is null and SHRTCKG_TERM_CODE = AND SHRTCKG_GRDE_CODE_FINAL IN ('F','F*','WP','WF','W') AND (RPRATRM_TERM_CODE = AND RPRATRM_FUND_CODE = 'PELL' AND RPRATRM_PAID_AMT > 0)

15 MINUS select spriden_id, spriden_first_name, spriden_last_name from spriden, SHRTCKG, RPRATRM where spriden_pidm = SHRTCKG_pidm and spriden_pidm = RPRATRM_pidm and spriden_change_ind is null and SHRTCKG_TERM_CODE = AND SHRTCKG_GRDE_CODE_FINAL NOT IN ('F','F*','WP','WF','W') AND (RPRATRM_TERM_CODE = AND RPRATRM_FUND_CODE = 'PELL' AND RPRATRM_PAID_AMT > 0) )

16 MINUS select spriden_id, spriden_first_name, spriden_last_name from spriden, RPRTIIV where spriden_pidm = RPRTIIV_pidm and spriden_change_ind is null and RPRTIIV_REV_AWARD_AMT IS NOT NULL

17 SQL in Banner


Download ppt "USING Sql to make banner better"

Similar presentations


Ads by Google