| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

12-03-11, 11:20
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
|
ER Diagram(CDM)
|
|
Can anyone help me in this Question .
found the entity type and the constraint , limitation, assumption and diagram
Represent part of the mlitary command structure of the armies of world. It is desired to represent every command unit and all army personnel, along with their ranks and personal details. Each country has one army who has a Commander-In-Chief. Each army is divided into a number of field armies. Each field army has between 90,000 - 200,000 soldiers and is headed by a General. There is only one Field Marshall in each army. Not all generals head a field army.
I think that entity type is :
country
army
field
but i dont now the attribute
So please if any one can help me?? 
|
|

12-03-11, 13:59
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
Quote:
Originally Posted by smiley4080
I think that entity type is :
country
army
field
but i dont now the attribute
|
that's a great start
for attributes, let's consider your first entity, country
does each country have a name?
vwalah!! an attribute
any other attributes you can think of?
probably not, so let's move on to army
does each army have a name?
vwalah!! an attribute
any other attributes you can think of?
what about the number of soldiers in the army?
another attribute?
get the idea?
|
|

12-04-11, 06:24
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
|
|
I think the attribute of countru is the name and the primary key is code >> what you said
country( countryCode, countryName)
so the entity and there attribute
is this correct
- country : name , code , army name
-Army : army name , country name , field army .
- field army : solders number , field army name , army name
- Solders : name , ID , rank
- General : army name , field army name ,
- Marshall : army name , ID , filed army name
- commander – in chief: name ,ID , army name , country name
|
|

12-04-11, 08:33
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
|
|
a person exists in their own right (ie has a name, DoB and whatever else you need to associate with that individual
unless that person is, say a member of the monarchy, its unlikely they will have more than one rank, so probably rank (or role) is part of the person table, but probably is a FK into another table which defines the rank
if you go down the route of having a separate table for rank then you could have a self referencing link in the rank/roll table which determines the hierarchy. however you may need to be careful if you application needs to know 'equivalence' of roles as this cannot necessarily be derived from the self referencing hierarchy model. this can be circumvented by including some form of level. eg role X is on level y
the advantage of the hierarchy model is that you can have as many levels as you required (in fact there is no limit on the number of levels in the hierarchy. if you go down the level indicator, make certain that you leave gaps between each level so that there is the opportunity to insert new levels if needs be
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
|
|

12-05-11, 05:14
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
I think Soldier, Marshall, Commander etc. are roles so that They are not entities.
so that the entities maybe

Country(CountryName, Country Code , ArmyID )
Army (ArmyID ,name, mobile , CPR , Country, rank )
|
|

12-05-11, 06:18
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
Quote:
Originally Posted by smiley4080
Country(CountryName, Country Code , ArmyID )
|
i don't think you want to make country belong to army
rather, i think you want to make army belong to country
that way, a country can have more than one army
|
|

12-05-11, 10:45
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
thanks r937 to mention that I forget  so that
entity will be like
Country ( country_code, country_name)
Army ( army_code, army_name, country_code)
can I add extra entity called
Soldiers( SoldierID, name)
|
|

12-05-11, 10:54
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
Quote:
Originally Posted by smiley4080
can I add extra entity called
Soldiers(SoldierID, name)
|
of course
you can add whatever entities you wish
but let me ask you about something that i find very serious, and disturbing
where are all these "ID" columns coming from?
how do you propose to ask each soldier what her "SoldierID" is?
|
|

12-05-11, 11:41
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
what is your suggestion??
because i don't now any thing about army is not my major?? 
|
|

12-05-11, 11:48
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
Quote:
Originally Posted by smiley4080
what is your suggestion?? 
|
create your ERD without resorting to the use of "ID" columns
|
|

12-05-11, 12:06
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 6
|
|
Quote:
|
create your ERD without resorting to the use of "ID" columns
|
but I think primary key is important to make relationship between the relation (Table or entities).
|
|

12-05-11, 12:29
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
Quote:
Originally Posted by smiley4080
but I think primary key is important to make relationship between the relation (Table or entities).
|
you are absolutely right
but why are you inventing an artificial "ID" column for this purpose?
surely each entity has some other unique attribute(s) which can be used as the primary key
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|