Question: Consider the following schema for a database that keeps information about business trips and their associated expenses by employees: EMPLOYEE ( SSN , Name, DeptNo,
Consider the following schema for a database that keeps information about business trips and their associated expenses by employees:
EMPLOYEE SSN Name, DeptNo, JobTitle, Salary
TRIP TripId DepartureCity, DestinationCity, DepartureDate, ReturnDate, SSN
EXPENSE
TripId Item, Date, Amount
f Find the names of all employees who have any expense item with value "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 a single expense item of over $ since January of this year.
i Find the items and amounts of all expenses for a trip to Cairo beginning on January 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.
Write both relational algebra queries and SQL queries for each part.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
