Please consider offering answers and suggestions to help other students!
And if you fix a problem by following a suggestion here,
it would be great if other interested students could see a short
"Great, fixed it!" followup message.
Hi Team,
I have already completed most of the 2nd part of the project, however I have a major issue with it.
1. Since we are basing our SQL on the ERD, would it not work since the model we have been given is not in 3rd Normal Form which creates lots of redundancies in the code. I understand that we technically didn't learn normalisation yet during this project, however the actual SQL itself would require it so do i just assume it's existence for my SQL.
2. In the HiredVehicle Entity, it is linked to various other entities obviously requiring the Foreign keys from those that require it. However problem arises here, HiredVehicle has a Vehicle FK that references a Vehicle. Vehicle has a DepotID FK that references Depot.
But HiredVehicle also has DepotID as an FK referencing Depot. This creates a redundancy issue whilst also having the potential to create major errors in the design. Example: HiredVehicle has DepotID FK 1 and Vehicle FK 1. However Vehicle PK 1 references DepotID FK 2 instead of 1. Now we have related data that inconsistently references each other wrongly because DepotID is referenced twice both indirectly and directly. Realistically Depot should only be connected to Vehicle and we can find the related DepotID by searching into the VehicleID from HiredVehicle, which then allows us to find the DepotID from Vehicle to finally reference Depot.
3. In the text it clearly states each vehicle has a unique fleet membership number meaning that is the PK, so i do not understand why regnum is the PK. While yes I believe regnum should be the PK as it is also unique, the text is clearly stating fleetnum as a PK not regnum.
If I am not understanding this please advise me what I am understanding wrong. But I have done ERDs and made databases for 3/4 years now and I am slightly confused with this database design.
Thank you all,