Question: 4 . Consider the following schema for a database that keeps information about business trips and their associated expenses by employees, noting that SSN is

4. Consider the following schema for a database that keeps
information about business trips and their associated expenses by
employees, noting that SSN is a foreign key in Trip that refers to
Employee, and TripId is a foreign key in Expense that refers to Trip;
Employee(SSN, name, deptNo, jobTitle, salary)
Trip(tripId, departureCity, destinationCity, departureDate, returnDate,
SSN)
Expense(tripId, item, date, amount)
Write relational algebra queries for each of the following:
a. Get a list of all the different destination cities where the
employees have taken trips.
b. Find all the employee information for employees who work in
Department 10.
c. Get complete trip records (but not their associated expenses) for
all trips with departure dates after January 1 of the current year.
d. Find the names of all employees who have departed on trips from
London.
e. Find the SSN of all employees who have any single expense item
of more than $1,000 for any trip.
f. Find the names of all employees who have any expense item
called Entertainment.
g. Find the destination cities of all trips taken by employees who
have the job title of Consultant.
h. Find the names and departments of all employees who have any
single expense item of over $1,000 since January 1 of this year.
i. Find the items and amounts of all expenses for a trip to Cairo
beginning on January 3 of this year taken by employee Jones.
j. Find the names, departments, and job titles of all employees who
have any expense item with value Service Charge for trips taken
to Melbourne last year, along with the date and amount of the
expense.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!

Q:

K