I have a problem with acces, im trying to make database of airport and cant realy make one to one - one to one - one to one connection beetwen ticket, passanger and luggage. The idea is that one passanger can have one ticket and one luggage, and when im doing it like it is on picture i cant acces luggage from ticket neither from passanger only from luggage itself.
Mainly the diagram should be something like:
Simple Data and Keys:
Sample query(all tickets with relevant linked data):
SELECT Tickets.Ticket,
Tickets.Person,
Flights.Flight,
Luggages.Luggage
FROM Flights
INNER JOIN (
(Persons INNER JOIN Tickets ON Persons.ID = Tickets.Person)
LEFT JOIN Luggages ON Tickets.ID = Luggages.ID)
ON Flights.ID = Tickets.Flight;
Second view was the purpose, so it up to your side to do the adjustments.
Note: Person 3 do not have luggage. Person 1&2 use same flight.
MS Access was used, but design is not bound to a specific rdbms (only dialects adjustments for a particular implementation)
Also, there is an error on relation Persons-Tickets which should be 1-n.(similar Flight-Tickets).
Still additional constraints could be bound also. Eg: a person can be just on one flight is a specific time.