Re: Database modeling question

From: Cimode <cimode_at_hotmail.com>
Date: 3 Nov 2006 05:04:36 -0800
Message-ID: <1162559076.406431.318040_at_m73g2000cwd.googlegroups.com>


Vortexmind wrote:
> Hi
> I'm trying to model a database but I'm having troubles sorting out my
> ideas. Can anyone help?
>
> I have "Airplanes" & "Weapons" (and specialized weapons such as Guns,
> Bombs and so on that "extend" from Weapons). What I need to do is to
> describe "Configurations" of weapons, such as:
>
> 1) An "Airplane" can have 0 to many "Configurations" (0 means unarmed
> Airplane)
> 2) A Configuration is composed by 1 or more Weapons
> 3) I have to keep track of some attributes for each weapon in a given
> "Configuration". These attributes are not related to the weapon itself
> as they are related to the particular "Configuration" they're being
> used into.
>
> For example: we have "Airplane" A and weapons B,C and D.
>
> "Airplane" A has 2 "Configurations"
> 1) B and D
> 2) B and C
>
> In 1) B has 100 rounds and D has 200 rounds
> In 2) B has 150 rounds and D has 90 rounds
>
> Now, how can i realize it in a pratical way?
>
> For now, I have made three tables. Two of them represent Airplane and
> Weapon. The third one is the many-to-many relationship
> "Aircraft_mount_Weapon" . In this intermediary table I can place all
> the attributes for each weapon ... but I cannot find a pratical way to
> group the weapons in Configurations as descrived above. I thought about
> placing a "config_number" attribute in the "Aircraft_Mount_Weapon" so
> that I can tag each airplane-weapon association with an ID that
> represents the configuration ... but this can lead to some overhead
> with similar configurations ... do you have some better ideas?
>
> Thank you for any help!
> Vortexmind
At first look, 5 entities to get 2 M:N cardinalities between configuration/weapons AND plane/configuration should get enough combinations for the case submitted

weapon:model(PK) --> Weapon1
weapon_configuration: model(FK), configuration(FK), qty(NOT NULL) --> Weapon1, 'A', 200
configuration:configuration(PK) --> Ex: 'A' configuration_plane:configuration(FK), plane(FK) --> 'A', plane1 plane:model(PK) --> Ex: plane1

Hope this helps... Received on Fri Nov 03 2006 - 14:04:36 CET

Original text of this message