Professional Documents
Culture Documents
Unsafe Query
A TRC Query with an infinite set of tuples in the result is said to be an unsafe query. the
reason for a query being unsafe is basically the use of a universal tuple variable. The domain
of universal tuple variable is not restricted to the relation for which it is getting used
Example:{t| t∉ Student}- this query will result in all the tuples which are not part of the
student table which are infinite. hence the query is unsafe.
Domain Relational Calculus(DRC)
As compared to tuple relational calculus, domain relational calculus makes use of the list of
attributes that needs to be selected from the relation based on the condition. Domain
relational calculus is the same as tuple relational calculus it only differs in the way of
selecting the attributes instead of selecting whole tuples. It is denoted as below:
{< a1, a2, a3, … an > | P(a1, a2, a3, … an)}
Where a1, a2, a3, … an are attributes of the relation and P is the condition.
For e.g.: Select EMP_NAME and EMP_ID of employees who work for department 12
{<EMP_ID, EMP_NAME> | <EMP_ID, EMP_NAME> ? EMPLOYEE Λ DEPT_ID = 12}