|< < 2 > >|

Relational Algebra

  • So far we have considered how to structure data using the relational model.

  • We need a language to answer questions — queries — about the data.

  • SQL is that language.

  • Before we get to SQL, it is important to learn Relational Algebra.

  • is the basis of SQL semantics,

  • And of query optimization techniques which are essential to making SQL practical.

Algebra

  • An is a set of operations on values of some type, which yield values of the same type.

  • E.g. +, −, ×, and ÷ are operations on numbers which yield numbers.

Relational Algebra

  • An algebra for relations (tables).

  • Set-oriented: a relation is a set.

  • This was a revolutionary idea in 1970, because all database languages at the time were record-at-a-time.

|< < 2 > >|