relationalAlgebra - Relational Algebra 1 Relational Query...

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

View Full Document Right Arrow Icon
1 Relational Algebra
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Relational Query Languages Query languages : Allow manipulation and retrieval of data from a database. Relational model supports simple, powerful query languages: Strong formal foundation based on logic. Allows for much optimization. Query Languages != programming languages! QLs not expected to be “Turing complete”. QLs not intended to be used for complex calculations. QLs support easy, efficient access to large data sets.
Background image of page 2
3 Formal Relational Query Languages Two mathematical Query Languages form the basis for “real” languages (e.g. SQL), and for implementation: Relational Algebra : More operational, very useful for representing execution plans. Relational Calculus : Lets users describe what they want, rather than how to compute it. (Non- operational, declarative .)      understanding SQL, query processing!  
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Preliminaries A query is applied to relation instances , and the result of a query is also a relation instance. Schemas of input relations for a query are fixed The schema for the result of a given query is also fixed! Determined by definition of query language constructs. Positional vs. named-field notation: Positional notation easier for formal definitions, named- field notation more readable. Both used in SQL
Background image of page 4
5 Example Instances sid sname rating age 22 dustin 7 45.0 31 lubber 8 55.5 58 rusty 10 35.0 sid sname rating age 28 yuppy 9 35.0 31 lubber 8 55.5 44 guppy 5 35.0 58 rusty 10 35.0 sid bid day 22 101 10/10/96 58 103 11/12/96 R1 S1 S2 Sailors” and “Reserves” relations for our examples. We’ll use positional or named field notation, assume that names of fields in query results are `inherited’ from names of fields in query input relations.
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Relational Algebra Basic operations: Selection ( ) Selects a subset of rows from relation. Projection
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/12/2011 for the course MAT 116 A MAT 116 A taught by Professor Hawkins during the Spring '10 term at University of Phoenix.

Page1 / 21

relationalAlgebra - Relational Algebra 1 Relational Query...

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

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