But what if I want to ask, what Car does the Person "currently driving"? Person 1:1 Cars
I thought of having a boolean field called driving in Cars table but I don't know. Should I create another table named Driving or something that holds both Person and Cars id? Or maybe a field driving_id in Persons table?
But what if I want to ask, what Car does the Person "currently driving"? Person 1:1 Cars
I thought of having a boolean field called driving in Cars table but I don't know. Should I create another table named Driving or something that holds both Person and Cars id? Or maybe a field driving_id in Persons table?
@chron In this case, I’d say you’ve instead found a new entity in your system. You’re wanting to record some sort of “trip” or “journey”, that would have foreign keys pointing to the driver and what car they drove to complete the journey/trip.
If a trip to point X was taken, entering that cars unique id in a field for the trip would work.
But there are of course several ways do do such things.