Self-joins Using PROC SQL

Slides:



Advertisements
Similar presentations
Chapter 4 Joining Multiple Tables
Advertisements

What would you like to practice?
Thomas short. It was a very insane world in the 1800’s for Richmond. First having a new president! Abraham Lincoln. On the Other side was John Wilkes.
Managing Processing Using PROC SQL Chapter 8 1 Imelda Go, John Grego, Jennifer Lasecki, 2011.
Southeast Region Geography Challenge.
Union and Confederate States
Come to the southeast By Nick. Florida Come to Florida there are many cities and it is always warm. The everglades are very big and deep.
State Capital Project Alabama Created by: Shanynna Knight
A Nation Divided Against Itself
Republican Party Lincoln and Douglas Debates A series of 7 formal political debates 2.Abraham Lincoln and Stephen Douglas were campaigning for.
Southeast Region Georgia.
FLORIDA  Florida is part of the South East states.  It is located below Georgia.  Florida is always hot.  You can go swimming through out the year.
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt States 1 States 2States 3Capitals.
States of the Southeast Region
Alabama. Louisiana Florida Tennessee Kentucky Virginia North Carolina South Carolina Georgia Arkansas.
MARYLAND.  Maryland  North Carolina  South Carolina  Virginia  West Virginia  Georgia  Florida  Louisiana  Arkansas  Tennessee  Kentucky 
Tennessee. Virginia West Virginia Maryland North Carolina South Carolina Georgia Florida * Louisiana * Arkansas * Tennessee * Kentucky * Delaware * Alabama.
Cleveland,Ohio Anh-Tuan Rolling Hills Room
Pre-Civil War Chapter 15, Section 4 Secession and War.
Our Community Standing Strong (OCSS) Regional Meeting Middle Tennessee Nashville, Tennessee November 8, 2014.
Office of Student-Athlete Success Faculty Senate October 9, 2013.
QUALITY ASSURANCE/ QUALITY CONTROL ANALYSIS SOUTHERN RESEARCH STATION FY 2003 October 22, 2003.
Commissioner of SEC. Full Name: Michael Lawrence Slive Birthday: July 26, 1940 (71 years old) College: Dartmouth, University of Virginia,
– Connecticut. What’s A Good Score? Science: 24 out of 36.
2014 Conference Greats Football  Configuration: 8 cards per pack 24packs per box 12 boxes per case  Set Breakdown: Regular Cards – 86 Schedule Cards.
The NCAA in 2035 By: Mr. Dunlap Why we are here? We have already seen during the past few years, change is coming with the NCAA. Football is leading.
The Statistics of Slavery To “An American Slave Market” by Taylor, 1852.
Chapter 4, Section  The Union army loses in the Battle of Chancellorsville  Stonewall Jackson was shot by his own men here! Died shortly after.
DESCRIBING RELATIONSHIPS 3.1 Scatterplots. Questions To Ask What individuals do the data describe? What are the variables? How are they measured? Are.
United States Vacations Destinations Sample Project.
Question 1Question 1 What is the oldest school in the SEC? A.University of Georgia B.Louisiana State University C.Tulane University.
Southeast States Virginia Atlantic Coast Gulf Coast Inland South.
USING THE CALCULATOR 3.2 Residuals and the Least-Squares Regression Line.
Southeast Region By Griffin Levine. Southeast Region Ever need a place to go? Well then the Southeast Region is your place to stay! There are tons of.
AFRICAN-AMERICAN TYLER WEBER – SOCIAL STUDIES – 11/18/2015.
Southeast & Southwest Quiz Review. Virginia (Richmond)
Welcome to the 2014/2015 District 11. Tennessee Mississippi Alabama.
Nashville By: Miss Gardner. Abbreviation: TN Nickname: The Volunteer State Date admitted to the U.S.: Wednesday, June 1, 1796 Flag:
Southeast Region Mississippi. States in the Southeast Region Virginia West Virginia Maryland North Carolina South Carolina Georgia Florida Louisiana Arkansas.
North Carolina.
Causes of the Civil War: Part 4
Snappy SS Week 5. Make sure you have a proper heading on lined paper and you answer in complete sentences  Use Map H (& Map F) to answer these questions.
ELECTION OF 1860 Road to Civil War chart. DO NOW: Recreate the diagram and complete (p.449 – 450)
Proposed Policy Revision: Changing the Course Withdrawal Deadline University Senate Meeting.
Southeast »Amber Amer Joe. Geography Alabama, Arkansas, Florida, Georgia, Kentucky, Louisiana, Mississippi, North Carolina, South Carolina, Tennessee,
Southeastern Region of the USA
Describing Relationships
Causes Of The Civil War Melvin Matheny.
Proposed Policy Revision: Changing the Course Withdrawal Deadline
3.2 Residuals and the Least-Squares Regression Line
A New Political Party.
Advisory Committee Meeting September 15, 2016
Events leading up to the Civil War
The NCAA in 2035 By: Mr. Dunlap.
Search Term Usage Analysis
Chapter 15, Section1 The Two Sides
Today in History 5/ First recorded witch execution in Massachusetts 1937 The Golden Gate Bridge officially opens 1941 World War II: President Roosevelt.
Eastern United States Geography Quiz
Location of Georgia Chapter 1 Section 1
The New Era of the NCAA By: Mr. Dunlap.
Nationalism Sectionalism
Southern Secession Goal: Examine the reasoning behind the South’s secession from the United States.
SQL set operators and modifiers.
The War Begins Chapter 16 Section 1.
Unit 2: Westward Expansion
Election of 1860.
Warm-up How would you best describe Abraham Lincoln’s view on slavery in 1860? He believed that slavery was necessary for the cotton industry. He wanted.
States During the Civil War
U.S. Geography The South.
Events leading up to the Civil War
Presentation transcript:

Self-joins Using PROC SQL Chapter 3 Supplement Self-joins Using PROC SQL

Self-Joins Self-joins, or Reflexive Joins are used to compare values within a data set Examples typically use equality operations to create a join Interesting short-cut to create choose(n,2) pairs

2011 SEC Football Scores Date Winning Team Winning Score Losing Team Losing Score 11/19/2011 Alabama 45 Georgia Southern 21 Arkansas 44 Mississippi State 17 LSU 52 Ole Miss 3 Tennessee 27 Vanderbilt 11/12/2011 South Carolina Florida 12

Self-Joins Note that USC’s winning score on November 12 matches Mississippi State’s losing score on November 19 We can record all such instances using a reflexive join The reflexive join can look like an outer union

Self-Join Syntax proc sql; select winner.wscore, winner.date, winner.wteam, loser.date, loser.lteam from secscores as winner, secscores as loser where winner.wscore=loser.lscore; quit; Most examples make sure a record doesn’t join with itself, but that can’t happen here (no ties in football).

Self-Join Syntax We do not have to use equality operators: proc sql; select winner.wscore, winner.date, winner.wteam, loser.date, loser.lteam from secscores as winner, secscores as loser where winner.wscore lt loser.lscore; quit; I have another example just for fun. End of Day 9 (50 minutes).