Relational Algebra

1 / 5

# Relational Algebra - PowerPoint PPT Presentation

Relational Algebra. A collection of operators for manipulating relations A relation is a set of tuples The result of each relational algebra expression is a relation For this discussion we will strictly following the definition of a set so the will be no duplicate tuples in a relation

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## Relational Algebra

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
1. Relational Algebra • A collection of operators for manipulating relations • A relation is a set of tuples • The result of each relational algebra expression is a relation • For this discussion we will strictly following the definition of a set so the will be no duplicate tuples in a relation • We will relax this constraint when we talk about relational algebra in the context of query processing

2. Relational Algebra Operators • Select • σcondition • Project • πattr list • Union • ⋃ • Set Difference • − • Intersection • ⋂ • Cartesian product • ×

3. Relational Algebra Operators • Joins • Natural join • ⋈ • Equi join and Theta join • ⋈Condition • Division • ÷ or ∕ • Renaming • Expression[A1, A2, …An]

4. Example Tables T1 T2

5. Example Expressions • What is the result of each of the following expressions? • σA < 5T1 • σA < 5 and B > 4T1 • πA, DT1 • T1 ⋈ T2 • T1 ⋈T1.A=T2.Aand T1.B=T2.B T2 • T1 ⋈T1.C < T2.B T2