# 12_RelationalAlgebra.pdf - CITS1402 Relational Database...

• AgentBoulder1269
• 22
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 7 out of 22 pages.

CITS1402 Relational Database Management Systems Video 12 — Relational Algebra Gordon Royle Department of Mathematics & Statistics
Relational Algebra The (mathematical) theory underlying relational databases. Traditional component of courses on relational databases. Useful for theoretical discussion of relational databases, but not really important for practical use of relational databases. We’ll just give a very brief overview here.
Expressions in Algebra An expression in (normal) algebra is something like ( x + y )( x - y ) where x and y are variables combined in a particular way with arithmetic operators. If we “plug in” specific numbers for x and y , then the value of the expression can be calculated, and it is itself a number .
Algebraic Manipulation From the rules of algebra , we know that x 2 - y 2 = ( x - y )( x + y ) and so we know that x 2 - y 2 can always be replaced with ( x - y )( x + y ) . In this sort of way, algebraic expressions can be rewritten in a way that is guaranteed to be mathematically correct . Why? One might be cheaper or safer to calculate.
Relations Mathematically, a relation is just a set of tuples — consider the following table called R A B C 1 0 1 2 1 1 1 3 0 It has three rows so R = { (1 , 0 , 1) , (2 , 1 , 1) , (1 , 3 , 0) }
Relational Algebra A legal expression in
• • • 