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.

 
Go Back  dBforums > General > Database Concepts & Design > ER Diagram(CDM)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-11, 11:20
smiley4080 smiley4080 is offline
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??
Reply With Quote
  #2 (permalink)  
Old 12-03-11, 13:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by smiley4080 View Post
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-04-11, 06:24
smiley4080 smiley4080 is offline
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
Reply With Quote
  #4 (permalink)  
Old 12-04-11, 08:33
healdem healdem is offline
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
Reply With Quote
  #5 (permalink)  
Old 12-05-11, 05:14
smiley4080 smiley4080 is offline
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 )
Reply With Quote
  #6 (permalink)  
Old 12-05-11, 06:18
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by smiley4080 View Post
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 12-05-11, 10:45
smiley4080 smiley4080 is offline
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)
Reply With Quote
  #8 (permalink)  
Old 12-05-11, 10:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by smiley4080 View Post
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 12-05-11, 11:41
smiley4080 smiley4080 is offline
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??
Reply With Quote
  #10 (permalink)  
Old 12-05-11, 11:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by smiley4080 View Post
what is your suggestion??
create your ERD without resorting to the use of "ID" columns
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #11 (permalink)  
Old 12-05-11, 12:06
smiley4080 smiley4080 is offline
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).
Reply With Quote
  #12 (permalink)  
Old 12-05-11, 12:29
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by smiley4080 View Post
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Tags
database

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On