Reading:  

Introduction to database management systems


Relational Algebra

Relational database systems are expected to consist of a query language that can assist its users to query database instances. The two kinds of query languages: relational algebra and relational calculus.

Relational Algebra

Relational algebra is a procedural query language, which consists of a set of operations that take one or two relations as input and produce a new relation as result. The some of the basic operations are:

  • Selection (σ): Selects a subset of rows from relation.
  • Projection (π): Deletes unwanted columns from relation.
  • Cross-Product (×): Allows us to combine two relations.
  • Set-Difference (−): Tuples in reln. 1, but not in reln. 2.
  • Union (U): Tuples in reln. 1 and in reln. 2

 

Projection 

Deletes attributes that are not in projection list.

Projection operator has to eliminate duplicates.

Notation − ∏A1, A2, An (r) 

Where A1, A2, An are attribute names of relation r.

 

Selection 

Selects rows that satisfy selection condition. 

Notation − σp(r) 

 

Cross-Product 

Each row of R1 is paired with each row of S1.

 

Set-Difference

The result of set difference operation is tuples, which is present in one relation not in second relation.

Notation − r – s

Union

The operations take two input relations, which should be union-compatible on: 

  • Same number of fields.
  • Fields have same type.

 

Relational Calculus

Relational calculus is nonprocedural type. There are two approaches: tuple relational calculus and domain relational calculus

 

Tuple Relational Calculus (TRC): Variables range over (i.e., get bound to) tuples. 

Notation − {T | Condition}

Domain Relational Calculus (DRC): Variables range over domain elements (= field values).

Notation − n{ a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)}

Where a1, a2 are attributes and P stands for formulae built by inner attributes

Both TRC and DRC are simple subsets of first-order logic

 

 

 

 

Description

This free tutorial covers the basics of database management system to help you with your understanding on the topic, Please note that this tutorial assumes that either you are a beginner or just want to brush up your understanding on DBMS

Tutorial covers the topics below

  • What is DBMS?
  • Architecture
  • Data Models
  • Data Schemas
  • Data Independence
  • Entity-Relation Model Basic Concept
  • Entity-Relation Diagram Representation
  • Generalization, Aggregation
  • Codd's 12 Rules
  • Relational Data Model
  • Relational Algebra
  • Structured Query Language
  • Normalization
  • Database Joins
  • Storage System
  • Indexing
  • Hashing
  • Transaction
  • Concurrency Control and Deadlock
  • Data Backup and Recovery

 



Audience

Absolute beginners or students who wish to brush up their understanding on DBMSes

Author: Subject Coach
Added on: 16th Sep 2015

You must be logged in as Student to ask a Question.

None just yet!