CS122aSlides06

# CS122aSlides06 - ICS122A EECS116 Introduction to Data...

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

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

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

View Full Document
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
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

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

View Full Document
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
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

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

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

## This note was uploaded on 06/18/2009 for the course CS 122a taught by Professor Carey during the Spring '09 term at UC Irvine.

### 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
Ask a homework question - tutors are online