Domain Relational Calculus in DBMS
Domain Relational Calculus in DBMS
In this article, we will learn about Domain Relational Calculus in DBMS. 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.
- 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 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 > | ∈ Student ∧ age <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 > | ∈ Employee ∧ Salary > 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.
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment