# Domain Relational Calculus in DBMS

**Domain Relational Calculus** is a non-procedural query language equivalent in power to Tuple Relational Calculus. Domain Relational Calculus provides only the description of the query but it does not provide the methods to solve it. In Domain Relational Calculus, a query is expressed as,

{ < x_{1}, x_{2}, x_{3}, ..., x_{n}> | P (x_{1}, x_{2}, x_{3}, ..., x_{n}) }

where, < x_{1}, x_{2}, x_{3}, …, x_{n} > represents resulting domains variables and P (x_{1}, x_{2}, x_{3}, …, x_{n} ) represents the condition or formula equivalent to the Predicate calculus.

** Predicate Calculus Formula:**

- Set of all comparison operators
- Set of connectives like and, or, not
- Set of quantifiers

**Example:**

**Table-1: Customer**

Customer name | Street | City |
---|---|---|

Debomit | Kadamtala | Alipurduar |

Sayantan | Udaypur | Balurghat |

Soumya | Nutanchati | Bankura |

Ritu | Juhu | Mumbai |

**Table-2: Loan**

Loan number | Branch name | Amount |
---|---|---|

L01 | Main | 200 |

L03 | Main | 150 |

L10 | Sub | 90 |

L08 | Main | 60 |

**Table-3: Borrower**

Customer name | Loan number |
---|---|

Ritu | L01 |

Debomit | L08 |

Soumya | L03 |

**Query-1:** Find the loan number, branch, amount of loans of greater than or equal to 100 amount.

{≺l, b, a≻ | ≺l, b, a≻ ∈ loan ∧ (a ≥ 100)}

Resulting relation:

Loan number | Branch name | Amount |
---|---|---|

L01 | Main | 200 |

L03 | Main | 150 |

L10 | Sub | 90 |

**Query-2:** Find the loan number for each loan of an amount greater or equal to 150.

{≺l≻ | ∃ b, a (≺l, b, a≻ ∈ loan ∧ (a ≥ 150)}

Resulting relation:

Loan number |
---|

L01 |

L03 |

**Query-3:** Find the names of all customers having a loan at the “Main” branch and find the loan amount .

{≺c, a≻ | ∃ l (≺c, l≻ ∈ borrower ∧ ∃ b (≺l, b, a≻ ∈ loan ∧ (b = “Main”)))}

Resulting relation:

Customer Name | Amount |
---|---|

Ritu | 200 |

Debomit | 60 |

Soumya | 150 |

**Note:**

The domain variables those will be in resulting relation must appear before | within ≺ and ≻ and all the domain variables must appear in which order they are in original relation or table.

## Recommended Posts:

- Tuple Relational Calculus (TRC) in DBMS
- Difference between Relational Algebra and Relational Calculus
- Domain Key Normal Form in DBMS
- Relational Model in DBMS
- Introduction of Relational Algebra in DBMS
- Introduction of Relational Model and Codd Rules in DBMS
- Collision Domain and Broadcast Domain in Computer Network
- Domain Name Server (DNS) in Application Layer
- Address Resolution in DNS (Domain Name Server)
- Classless Inter Domain Routing (CIDR)
- Properties of Relational Decomposition
- Anomalies in Relational Model
- Basic Operators in Relational Algebra
- Extended Operators in Relational Algebra
- Query Optimization in Relational Algebra

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.