Domain Relational Calculus in DBMS

Tuple  relational calculus  

  • Relational algebra specifies procedures and methods to fetch data hence is called as a procedural query language ,whereas relational calculus is a non procedural query language focuses on just fetching data rather than how the query will work and how data will be fetched 
  • Simply relational calculus is nothing but focusing on what to do rather than focusing on how to do 

Relational calculus is present in two formats 

  • Tuples relational calculus(TRC) 
  • Domain relational calculus(DRC)
DRC

Domain  Relational Calculus (DRC) in DBMS 

  • In Domain relational calculus filtering of records is done based on the domain of the attributes rather than tuple values 
  • A domain is nothing but the set of allowed values in the column of a table 

Syntax: 

{ c1, c2, c3, ..., cn | F(c1, c2, c3, ... ,cn)} 

where, c1, c2… etc represents the domain of attributes(columns) and F represents the formula including the condition for fetching the data. 

Example 1

{< name, age > | ∈ Studentage <21} 

Again, the above query will return the names and ages of the students in the table Student who not greater than 21 years old 

Example 2

{< Fname, Emp_ID > | ∈ EmployeeSalary > 10000} 

The result here will be returning the Fname and Emp_ID values for all the rows in the employee table where salary is greater than 10000.