Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

translating composite attributes from an ERD

Status
Not open for further replies.

NuJoizey

MIS
Aug 16, 2006
450
US
OK refresh my memory....

If I have an ERD showing a composite attribute belonging to the entity "Person", where the composite attribute "Name" consists of two atomic attributes "FirstName" and "LastName"

How does this translate into table structure...or...does it even translate into table structure at all?

If so, then is there anything particular that needs to be done in the DDL to designate this?
 
The table structure based on this description seems to be very simple - Person table with PersonID (I assume), FirstNAME field and LastName field. Or are you looking for something else?
 
yes, what you have written is exactly right. Three fields - but the ERD blueprint explicitly shows a composite attribute called "name" which includes FN and LN, and so I'm wondering what if anything needs to be done to account for this when I create the tblPerson table.
 
I would probably not store the duplicate data in the table. Instead, I would store the smallest bit of data (in this case the first and last name as two separate columns). Then, if it made things easier for me, I would add a computed column for the full name.

The advantage of a computed column is..... less storage space. Plus, it's easier to change if you ever needed to. For example, if you add a middle name column and wanted to display the middle initial in the full name. Just change the definition of the computed column.

Make sense?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
so then there is nothing special I need to do to account for the indication of a composite attribute on the ERD? What I'm trying to do is build tables based on this diagram (this is a simplified version, but the concept is the samme)
 
Speajing from expereince, never store name as anything other than 4 fields, first_name, middle_name, last_name, suffix. It is a whole lot easier to combine these fields together to get the fullname (and that can be done ina computed field) than it is to break it out when you have the whole name in one field and want to find everyone named Smith.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top