4

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

1
  • It might be a good idea to study a bit on Database Normalization. This can help you with the creation of your database. The first 3 forms already help you on the usage/need of foreign keys.
    – Marco
    Commented Aug 17, 2015 at 11:34

1 Answer 1

1

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.