Download presentation
Presentation is loading. Please wait.
1
Chapter 3 Supplemental Slides
Natural Join Demonstration Welcome to the natural join demonstration: - See the derivation of rows in the result of a natural join operation - Complements the static presentation in the lecture notes and textbook - Can use with Chapters 3 or 4 - Understanding the join operator is crucial for developing query formulation skills - Repeat this exercise yourself (own small tables ) until the join operator becomes second nature - Play it yourself at your own pace using Powerpoint notes
2
Natural Join Animation
Offering OfferNo FacSSN 1111 2222 3333 Faculty FacSSN FacName JOE SUE SARA To begin the animation, let's use small input tables: - Small version of the Offering and Faculty tables used in textbook chapter 4 - Use small versions because of screen limitations and focus attention on essential ideas - Same ideas apply to tables with more rows and columns - Using small tables can help you to understand the natural join operation - Useful for difficult problems especially in textbook Chapter 9 Join condition: Faculty.FacSSN = Offering.FacSSN (highlight columns) - Natural join requires same unqualified names and equality as comparison operator Matching rows: - First Faculty row matches with rows 1 and 3 of Offering (point) - Second Faculty row matches with row 2 of Offering (point) - Third Faculty row does not match any Offering rows - Natural join: discard one of the join columns (one column is duplicate) - Column discarded does not matter here
3
Natural Join Animation
Offering OfferNo FacSSN 1111 2222 3333 Faculty FacSSN FacName JOE SUE SARA First Offering row combines with the first Faculty row Notice that the OfferNo column comes from the Offering table The FacSSN and FacName columns come from the Faculty table. Faculty Natural Join Offering OfferNo FacSSN FacName 1111 JOE
4
Natural Join Animation
Offering OfferNo FacSSN 1111 2222 3333 Faculty FacSSN FacName JOE SUE SARA Second Offering row combines with the second Faculty row Faculty Natural Join Offering OfferNo FacSSN FacName 1111 JOE 2222 SUE
5
Natural Join Animation
Offering OfferNo FacSSN 1111 2222 3333 Faculty FacSSN FacName JOE SUE SARA Third Offering row combines with the first Faculty row Third Faculty row does not combine with any Offering rows: faculty not teaching. Repeat this exercise yourself using your own small tables Faculty Natural Join Offering OfferNo FacSSN FacName 1111 JOE 2222 SUE 3333 JOE
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.