1 / 5

Relational Algebra

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

hastin
Download Presentation

Relational Algebra

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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

More Related