The Division Operation
The division operation in relational algebra, denoted by ÷, is suited to queries that include the phrase “for all”.
Suppose that we
wish to find all customers who have an account at all branches located in Dhaka.
Firstly we can
obtain all branches in Dhaka by the expression:
We can find all
(customer_name, branch_name) for which the customer has an account at a branch
by writing:
We need to find
customers who appear in r2 with every branch name in r1. The operation that
provides exactly those customers is the divide operation that is, the customers
who have an account for all branches in Dhaka city.
No comments:
Post a Comment