Given the following 7 relations:
MIScompany (name, address, phone, email, FedTaxId, StaTaxId)
branch (branchId, name, address, phone, email, FedTaxId, StaTaxId)
employee (empId, driverId, ssno, name, branchId)
customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId)
equipment (equipId, name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId )
manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email)
rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId)
1)
Use relational algebra to list every equipment name with more than three quantities and the name of customer who have rented them. The report should contain equipment name and customer name.
1)Use relational algebra to list every equipment name with more than three quantities and the name of customer who have rented them. The report should contain equipment name and customer name.
Solution:-
Here hint is :-
The INNER JOIN keyword selects records that have matching values in both tables
Here is the Command:-
SELECT E.name,C.name FROM equipment E INNER JOIN rental R ON E.equipid= R.equipid
INNER JOIN customer C ON R R.empid = C.empid Group BY E.name HAVING COUNT(*)>3;
Get Answers For Free
Most questions answered within 1 hours.