SALESPERSON (SSN, Name, Start - Year, Dept - No) TRIP (SSN, From - City, To - City, Departure - Date, Return - Date, Trip - Id) EXPENSE (Trip - Id, Account#, Amount)
SALESPERSON (SSN, Name, Start - Year, Dept - No) TRIP (SSN, From - City, To - City, Departure - Date, Return - Date, Trip - Id) EXPENSE (Trip - Id, Account#, Amount)
3a)
SALESPERSON(Ssn, Name, Start_year, Dept_no)
TRIP(Ssn, From_city, To_city, Departure_date, Return_date, Trip_id)
EXPENSE(Trip_id, Account#, Amount)
The schema of this question has the following two foreign keys:
1. The attribute SSN of relation TRIP that references relation SALESPERSON, and
2. The attribute Trip_ID of relation EXPENSE that references relation TRIP.
In addition, the attributes Dept_No of relation SALESPERSON and Account# of relation
EXPENSE are probably also foreign keys referencing other relations of the database not
mentioned in the question.
3b)
The JOIN operation, denoted by is used to combine related tuples from two relations
into single tuples.
EQUIJOIN Operation
The most common use of join involves join conditions with equality comparisons
only
Such a join, where the only comparison operator used is =, is called an
EQUIJOIN.
In the result of an EQUIJOIN we always have one or more pairs of attributes
(whose names need not be identical) that have identical values in every tuple.
NATURAL JOIN Operation