I’m trying to make an application about formula 1. I have three tables: Team, Driver, And Race Results. I’m thinking about three options (and maybe I’m missing more):
Have a derived table Driver_Team. Have a Driver_TeamId in that table. Use that Driver_TeamId in the Race Results table. This seems to solve most of the queries I think I am going to use, but feels awkward and I haven’t seen it anywhere.
Have Driver.DriverId and Team.TeamId in the Race Results table. This has the problem of not being able to add extra information. I don’t know yet what information, maybe the date of the start of joining a new team. Then I would need a junction table (because that information is not Race Result related).
The last one: Have a junction table Driver_Team, but have only the Driver.DriverId as Foreign Key in the Race Results table. Problem is, queries like “How much points did team x get in season y/several seasons” really really horrible.
Am I missing another solution? If yes, please tell me! 🙂 Otherwise, which of these solutions seems the best?
Thanks!
Your first option gets my vote. I’d also suggest adding a Race table (to hold data such as track, date, conditions, etc.), and make Race_Results the combination of Driver_Team and Race.