Sql-server – Database design for a car dealers website

database-designdatabase-recommendationsql server

I am creating a new website for all the car dealers in my region to show their cars on and i need your opinion on the database I have created because I have some doubts.

For instance, is it best to have a VehicleID as a foreign key in the TechnicalSpecifications table or should it be the other way around, like having a TechSpecID in the Vehicles table? I am a bit confused and every time I think about it I lose my focus and can't figure it out.

I appreciate your input on my work so far and if you have any comments on anything please do share.

enter image description here

Best Answer

I would say that your second suggestion, haivng a TechSpecID in the Vehicles table, makes the most sense. A way of thinking could be, is a Vehicle implementing a TechSpec or is a TechSpec implementing a Vehicle? I.e. what comes first (the Technical Specification) and what is 'using' your Technical Specifications (the vehicles). But, in the end, it's all down to your context and what makes the most sense in your particular situation.

You have a very broad question so it is difficult to answer specifically what you might be looking for.

One thing I'd like to point out, however, is that most people don't prepend tg_ or fwk_ to their table names. You could use schemas if you'd like to differentiate them some...