Sample Header Ad - 728x90

Converting from domain calculus to relational algebra

2 votes
0 answers
98 views
At university I have been given these three relations: >
> Customer (Name, City, Account)
> Offer (Product_Description Supplier, Price)
> Order (Name, Product_Description, Quantity, Supplier)
>
and this domain calculus: >
> {Name, City | ∃ Account, Product_Description, Supplier, Price, Quantity (
>     customer(Name, City, Account)
>     ∧ offer(Product_Description, Supplier, Price)
>     ∧ order(Name, Product_Description, Quantity, Supplier)
>     ∧ Price ≥ 100 ∧ Supplier = 'Meier' )}
>
I have been asked to express this domain calculus as a sentence and convert it to relational algebra. Sentence: List the name and cities of the customers who ordered a product that has a value greater than or equal to 100 and has supplier Meier. (I didn’t use "customers who ordered greater than or equal to 100" because it's possible that the customer ordered, for example, 2 products (quantity is 2) where each has a value of 50 euros.) Relational Algebra:
π name, city (Customer)
⋈ π name (Order ⋈ Price ≥ 100 ∧ Supplier = 'Meier' (Offer))
Is my relational expression accurate? There are many ways to express it but I tried to find the way with the best efficient execution plan. (Equivalence of expressions.)
Asked by Anes (63 rep)
Jun 29, 2018, 11:57 AM
Last activity: Mar 1, 2023, 08:28 AM