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 all equipment in detail, including the name of the customer if the equipment is currently rented out.
Relational Algebra:
equipment.equipId, equipment.name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId, customer.name (equipment rental customer)
SQL:
Select equipment.equipId, equipment.name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId, customer.name from equipment left join rental on equipment.equipmentId = rental.equipmentId left join customer on rental.custId = customer.custId;
Do ask if any doubt.
Get Answers For Free
Most questions answered within 1 hours.