Question: Write the relational algebra (as well as the SQL query) for the specification below using the relations also defined below: Retrieve the names of customers
Write the relational algebra (as well as the SQL query) for the specification below using the relations also defined below:
- Retrieve the names of customers and the part name of orders with a quantity greater than 10. PARTS(Pno, Pname, Qoh, Price, Olevel) CUSTOMERS(Cno, Cname, Street, Zip, Phone) EMPLOYEES(Eno, Ename, Zip, Hdate) ZIP_CODES(Zip, City, State) ORDERS(Ono, Cno, Eno, Received, Shipped) ODETAILS(Ono, Pno, Qty)
Where Qoh stands for quantity on hand and Olevel stands for (re)order Level. The P, C, E and O single-letter prefixes for attributes refer to the parts, customers, employees and orders relations, respectively. The other attribute names are self-explanatory
- Using a drawing tool such as draw.io, draw two initial relational algebra query trees for each of the queries above.
- Transform each of the initial query trees created above into a more efficient form (use the heuristic rules basically apply steps a-e in the query optimization example that we did in class)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
