Skip to content
  • Relational Algebra · DBMS

Relational Algebra

LearnViaNotes @learnvianotes· 2 min read

Relational algebra is a mathematical procedural query language containing operations to retrieve data. Relational calculus is its non-procedural, declarative counterpart.

Relational Algebra Operators

Basic Operators

Derived Operators

Relational Calculus Syntax Comparison

AspectTuple Relational Calculus (TRC)Domain Relational Calculus (DRC)
VariablesVariables represent entire rows (tuples). e.g., tVariables represent individual attributes (domains). e.g., x, y, z
Query focusFilters rows. Very close to SQL concept.Filters values in columns directly. More abstract.
Syntax{ t | P(t) }{ <x1, x2, ...> | P(x1, x2, ...) }
Example Query
(Get Names of Students in CS dept)
{ t.Name | t ∈ Students ∧ t.Dept = 'CS' }{ <n> | ∃ i, d (<i, n, d> ∈ Students ∧ d = 'CS') }

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report