We have N persons in a city and one Car. A person can be an owner of this Car but the condition is a person at a time. I mean if there are 5 persons only one of them can be owner of the car at a time.
now problem is any person can be the owner of this car at any moment(we can decide that with any logic, for e.g. every day owner can be change, or may be some more complex algorithm, but that doesn't matter, just keep in mind that owner has changed at this particular time moment and remained owner till a time)
A owner from time T1 to T2
another Owner from T2 to T3
... so on.
Now another thing is any person can left the city OR/AND a new person can come in the city and have same rights as others, I mean new person can be the owner of this car.
I want to design a DB for this problem so that I can be able to query all important things efficiently. e.g.
who was the owner of the car at this time-stamp.?
who were the owners of the car during this time period?,
longest time remained owner?
all persons in the city available at a time?
etc.
any suggestions would be appreciated.