1

I'm trying to suggest DB structure. There is little problem and I hope anyone can help me. There are following tables:

VEHICLE (basic entity with shared properties)

  1. id
  2. kind_id

KIND (personal car, utility vehicle)

  1. id
  2. name

KIND_SPECIFIC_EQUIPMENT (air-condition, airbag....) - possible equipment for specific kind

  1. id
  2. kind_id
  3. name

CAR_EQUIPMENT (just link-table) - equipment for concrete car

  1. vehicle_id
  2. kind_specific_equipment_id

My problem is, that I need to add "list of values" for some equipment. For example:

My kind of vehicle is "personal car" and "kind_specific_equipment" is "air-condition". There can be more kind of air-conditions (automatic, manual...) Do anyone known how I can do that?

MakoBuk
  • 464
  • 2
  • 8
  • 18
  • replace "air-condition" with "automatic-air-condition" and "manual-air-condition". – Sergio Tulentsev Jul 04 '14 at 12:00
  • But the "air-condition" is major table. The "automatic or manual" is type of air-condition. There is no possibility to insert type straight. There is possible that user know he has air-condition, but he doesn't know what type. I need to do it like VOL. – MakoBuk Jul 04 '14 at 12:11
  • So, create a table `kind_specific_equipment_attributes(equipment_id, name, value)`. – Sergio Tulentsev Jul 04 '14 at 12:13
  • Hey mate, now I know how to do that. create table `attributes` how you said, and like primary key do auto-increment and foreign key do equipment_id. I'm really tired today (Friday afternoon). Thanks much – MakoBuk Jul 04 '14 at 12:26

0 Answers0