2A.Consider the following relations for a database that keeps track of business trips
of salespersons in a sales office:
SALESPERSON(Ssn, Name, StartYear, DeptNo)
TRIP(Ssn, FromCity, ToCity, DepartureDate, ReturnDate, TripId)
EXPENSE(TripId, AccountNo, Amount)
i) A trip can be charged to one or more accounts. Specify the foreign keys for
this schema, stating any assumptions you make.
ii) Write relation algebra expression to get the details of salespersons who have
travelled between Mumbai and Delhi and the travel expense is greater that Rs.
50000.
iii) Write relation algebra expression to get the details of salesperson who had
incurred the greatest travel expenses among all travels made.
iv) List the salespersons who have not been on any trips.
v) Find the total number of trips made by each salesperson.
of salespersons in a sales office:
SALESPERSON(Ssn, Name, StartYear, DeptNo)
TRIP(Ssn, FromCity, ToCity, DepartureDate, ReturnDate, TripId)
EXPENSE(TripId, AccountNo, Amount)
i) A trip can be charged to one or more accounts. Specify the foreign keys for
this schema, stating any assumptions you make.
ii) Write relation algebra expression to get the details of salespersons who have
travelled between Mumbai and Delhi and the travel expense is greater that Rs.
50000.
iii) Write relation algebra expression to get the details of salesperson who had
incurred the greatest travel expenses among all travels made.
iv) List the salespersons who have not been on any trips.
v) Find the total number of trips made by each salesperson.