Defining an Attribute Makeup

Once you have decided on your initial attributes (database fields), you may need to
look into how to break this attribute down, a process more commonly known as
decomposing attributes. Decomposing an attribute takes the attribute from its
original form and divides it into its own components.
A simple example of this might be the breaking down of an Address attribute. An
Address might easily be broken down and defined using the following attributes to
store all of its data
 !treet " stores the !treet address for the record
 #own " stores the #own address for the record
 $ounty " stores the $ounty information for the record
 %ost$ode " stores the %ost$ode information of the record
#his process of decomposing the attribute helps you develop a fully normali&ed
database structure. Decomposing is also a function of usage as well.
'f, for example, an (mployees name is only ever needed in it)s fullest form, then
the developer may take the decision to not break this up into attributes of (mployee
*irst +ame and (mployee ,ast +ame.
Decomposing an attribute provides many benefits to an attribute that has not
undergone the process of being decomposed.
*irst off, Data Integrity is improved.
Data integrity:
 (nsures the quality of data within a database
 's about the actual values that are stored and used in an application)s data structures
 (nsures that an application exert deliberate control on every process that uses your data to
ensure the continued correctness of the information
 's applied through the careful implementation of several key concepts such as normali&ing data,
defining business rules, providing referential integrity and validating the data
Data 'ntegrity is a measure of how well data is kept consistent and flawless
throughout the whole (- model.
.hen attributes are decomposed, different methods of ensuring data integrity can be
applied to the broken down segments of data rather than to the attribute as a whole.
*or example, a /ouse +umber can be checked as an integer and the #own as a
string. !econdly, decomposing aids in the sorting and improving data retrieval
performance.
A generic attribute of Address contains a /ouse +umber, !treet Address, #own,
$ounty and %ost$ode. #o enable you to locate the the #own of 0ournmouth in
Dorset, you have to select the whole address attribute and parse this to find Dorset,
thereby degrading performance due to the redundant data being retrieved.
'f you have five separate attributes, you can easily select the #own column and
retrieve your results much more 1uickly. #his same rule applies to updating your
data. 't is far easier to update a single part of the Address rather than parsing and
then updating the whole Address attribute.
'n most cases, an attribute is identified for each entity that will act as a key. #his
attribute could be an (mployee +umber, %roduct $ode or simply an attribute to serve
no other purpose than to act as a key identifier. .hen an attribute is added solely for
the sake of being an identifier, it is known as a surrogate key. .hether you use a
natural or surrogate key, that will represent an important part in establishing
relationships. #he term %rimary 2ey is assigned to this attribute. (ven though some
-D03! do not mandate the use of a %rimary 2ey, one should be defined simply as a
matter of good practice.

Sign up to vote on this title
UsefulNot useful