note5-relationalalgbra

note5-relationalalgbra - 1 CSc 134 Database Management and...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 CSc 134 Database Management and File Organization 5. Relational Algebra Ying Jin Computer Science Department California state University, Sacramento 2 Relational Algebra A set of operations for the relational model. Enable a user to specify basic retrieval requests. The algebra operations produce new relations. The result of a retrieval is a new relation. A sequence of relational algebra operations forms a relational algebra expression result a relation represents the result of a database query. 3 Topics on relational algebra Unary Relational Operations Select project Relational Algebra Operations From Set Theory Union, intersection, minus Cartesian product Binary Relational Operations Join equijoin, natural join variations of join Division 4 The SELECT Operation σ <selection condition> (R) Filter - only those tuples that satisfy a qualifying condition appear in the result. Result: subset of the tuples Examples σ DNO=4 (Employee) σ (DNO=4 and salary>2500) or (DNO=5 AND salary>3000) (Employee) 5 6 The SELECT Operation (Cont.) Commutative σ <cond1> ( σ <cond2> (R)) = σ <cond2> ( σ <cond1> (R)) A cascaded SELECT operation may be applied in any order σ <condition1> ( σ < condition2> ( σ <condition3> ( R)) = σ <condition2> ( σ < condition3> ( σ < condition1> ( R))) Cascade of SELECT operations into a single SELECT operation σ <cond1> ( σ <cond2> (… ( σ <condn> (R))…) = 7 The Project Operation This operation selects certain columns from the table and discards the other columns. Creates a vertical partitioning – one with the needed columns (attributes) containing results of the operation other containing the discarded Columns....
View Full Document

This note was uploaded on 10/26/2009 for the course CSC CSC 134 taught by Professor Jinyin during the Spring '09 term at CSU Sacramento.

Page1 / 37

note5-relationalalgbra - 1 CSc 134 Database Management and...

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

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