CS122aSlides06 - ICS122A EECS116 Introduction to Data...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ICS122A / EECS116 Introduction to Data Management Spring 2009 Prof. Mike Carey Bren School of ICS UC Irvine Slides based on previous CS122a lecture notes as well as  material borrowed from U-Wisconsin, Stanford, & Berkeley
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ICS122A/EECS116 Notes 02 2 Announcements HWs and projects HW #2 available and due on Tuesday Project part 1 due next Thursday Discussion section meetings Discussion session w/Alex tomorrow AM Content will be HW and project Q&A plus “no cost quiz” Today Relational algebra, part 2
Image of page 2
ICS184 Notes 06 3 Review: Relational Algebra Operators Union, Intersection, Difference , , – Relations must have the same schema (result: same schema) Selection σ Choose rows from a relation (result: same schema) Projection Π Choose columns from a relation (result: depends on the selected attributes) Cartesian Product ×   Construct a new relation from several relations ( Results: attributes in two relations, use prefix to avoid confusion ) Theta Join Select tuples from × based on C (result: schema same as × ) Natural Join Select tuples from × based on common values of common attributes (result: Union of relations’ attributes, merge common attributes) Extended operators: Outer join ( left , right , full ) Renaming ρ Rename a relation and its attributes (result: new renamed attributes) C
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ICS184 Notes 06 4 Expressions ( a.k.a. Queries!) Sequence of operations Output of one operation is input to other operations Combine operators with parentheses and precedence rules Precedence of relational algebra operators 1. Selection, projection, rename (highest). 2. Product, join(s) 3. Intersection 4. Union, difference Parentheses can be inserted to force the order of operations
Image of page 4
ICS184 Notes 06 5 Expression Trees Leaves are operands: either variables standing for relations or particular, constant relations. Interior nodes are operators: applied to their child or children Expression trees help understand and analyze queries and execution plans E.g. List the highest balance of all the customers account Π acct1.balance account ρ acct1 acct1.balance < account.balance Π balance account account(custssn, balance) Custssn balance 111 20K 222 15K 333 10K
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ICS184 Notes 06 6 Example 3 (Review) List the highest balance of all the customers.
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern