ER diagram - design issues

1.4k Views Asked by At

There are 3 entities:

  1. vehicle_model
  2. vehicle
  3. extra_options (such as open top, leather seats, etc..)

Vehicle model can have a subset of the extra options.
Vehicle can have a subset of it's model extras.

I've been trying hours to figure out how to represent this as er diagram, but without success. I Thought about ternary relationship ,and although I don't understand it completely I think this isn't the way.
I thought about creating another 2 entities, model_ext & vehicle_ext ,so that vehicle_ext would be connected to model_ext but this isn't a good design.

This is my first er diagram design. I'm really lost (read er-diagram chapter in "Silberschatz, Database System Concepts" three times already) so any idea would be appreciated.

1

There are 1 best solutions below

3
On

did you try adding a new table say 'vehicle_vehicle_model_extra_options_map'? (you can name this table to any thing short, but for better explanation i use __map as a standard way for defining the map tables.)

note those two null able foreign key columns in this table. Basically, vehicle has one to many relation to extra_options, and vehicle_model has one to many relation to extra_options table, therefore the new table was added. enter image description here

updated: enter image description here