CS122aSlides06

CS122aSlides06 - ICS122A / EECS116 Introduction to Data...

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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 Today Relational algebra, part 2
Background 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
Background image of page 3

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

View Full DocumentRight 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
Background 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
Background image of page 5

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

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

Page1 / 28

CS122aSlides06 - ICS122A / EECS116 Introduction to Data...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online