Chapter06

# Chapter06 - Copyright 2007 Ramez Elmasri and Shamkant B...

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

Slide 6- 1 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe

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

View Full Document
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 6 The Relational Algebra and Calculus
Slide 6- 3 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter Outline Relational Algebra Unary Relational Operations Relational Algebra Operations From Set Theory Binary Relational Operations Additional Relational Operations Examples of Queries in Relational Algebra Relational Calculus Tuple Relational Calculus Domain Relational Calculus Example Database Application (COMPANY) Overview of the QBE language (appendix D)

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

View Full Document
Slide 6- 4 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Relational Algebra Overview Relational algebra is the basic set of operations for the relational model These operations enable a user to specify basic retrieval requests (or queries ) The result of an operation is a new relation , which may have been formed from one or more input relations This property makes the algebra “closed” (all objects in relational algebra are relations)
Slide 6- 5 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Relational Algebra Overview (continued) The algebra operations thus produce new relations These can be further manipulated using operations of the same algebra A sequence of relational algebra operations forms a relational algebra expression The result of a relational algebra expression is also a relation that represents the result of a database query (or retrieval request)

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

View Full Document
Slide 6- 6 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Brief History of Origins of Algebra Muhammad ibn Musa al-Khwarizmi (800-847 CE) wrote a book titled al-jabr about arithmetic of variables Book was translated into Latin. Its title (al-jabr) gave Algebra its name. Al-Khwarizmi called variables “shay” “Shay” is Arabic for “thing”. Spanish transliterated “shay” as “xay” (“x” was “sh” in Spain). In time this word was abbreviated as x. Where does the word Algorithm come from? Algorithm originates from “al-Khwarizmi" Reference: PBS ( http://www.pbs.org/empires/islam/innoalgebra.html )
Slide 6- 7 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Relational Algebra Overview Relational Algebra consists of several groups of operations Unary Relational Operations SELECT (symbol: σ (sigma)) PROJECT (symbol: π (pi)) RENAME (symbol: ρ (rho)) Relational Algebra Operations From Set Theory UNION ( ), INTERSECTION ( ), DIFFERENCE (or MINUS, ) CARTESIAN PRODUCT ( x ) Binary Relational Operations JOIN (several variations of JOIN exist) DIVISION Additional Relational Operations OUTER JOINS, OUTER UNION AGGREGATE FUNCTIONS (These compute summary of information: for example, SUM, COUNT, AVG, MIN, MAX)

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

View Full Document
Slide 6- 8 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Database State for COMPANY All examples discussed below refer to the COMPANY database shown here.
Slide 6- 9 Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/18/2009 for the course CS 348 taught by Professor Staff during the Fall '08 term at Purdue.

### Page1 / 81

Chapter06 - Copyright 2007 Ramez Elmasri and Shamkant B...

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

View Full Document
Ask a homework question - tutors are online