Consider the subsequent relations for a database which keeps track of business trips of salespersons in a sales office:
SALESPERSON (SSN, Name, start_year, Dept_no)
TRIP (SSN, From_city, To_city, Departure_Date, Return_Date, Trip_ID)
EXPENSE(TripID, Account#, Amount)
Specify the subsequent queries in relational algebra:
(i) Give the details (all attributes of TRIP) for trips which exceeded $2000 in expenses.
(ii) Print the SSN of salesman who took trips to ‘Honolulu'
(iii) Print the trip expenses incurred through the salesman with SSN= ‘234-56-7890'.Note in which the salesman might have gone on more than one trip. List them individually
Ans: (i) πTRIP.* (σ amount > 2000 (TRIP EXPENSE))
(ii) π SSN (σ to_city = ‘Honolulu' (TRIP))
(iii) πEXPENSE.tripid, amount (σ SSN = ‘234-56-7890' (TRIP EXPENSE))