Data and Entities

Chapter 2 - Relational Databases
byJohn Kauffman, Fabio Claudio Ferracchiatiet al.?
Wrox Press ?2002

The basic purpose of a database is to provide a construct in which we can model entities. Entities are models of the physical things or concepts that we will deal with in our applications. When we speak of modeling, we refer to the way we represent only those elements of an object that we are interested in storing.

For example, a model airplane represents only certain elements of a real airplane, such as its appearance. In most other ways, it differs significantly from the real airplane: for example, the material is different (plastic vs. metal), so if you were interested in modeling the stress on the wings of a real airplane during flight, the plastic model would be a poor model indeed. In this case, strips of the material used in wing construction - even if they don't look like the airplane - might serve as a much better model.

When we speak of entities, we refer to people, places, things or concepts that we want to store information about. Let's imagine that we're designing a database that would keep track of people, their addresses, and their phone numbers. In this example, the people, addresses, and phone numbers are the entities.

Moving on, each of these entities is a collection of attributes. An attribute is simply a descriptive piece of information that describes an entity. For example, the 'person' entity might have attributes such as 'first name' and 'last name', while the 'address' entity would have 'city' and 'country' (among others). A set of one or more attributes is called a tuple.

Note 

An entity is a person, a place, a thing, or a concept.

An attribute is a characteristic of an entity. In other words, it is a piece of data that describes the entity.

A tuple is a set of differentiating attributes. That is, a tuple is the set of attributes that make one entity different from another.

In data modeling terms, then, a person is represented by the tuple that is the collection of attributes such as 'first name', 'last name', 'address', 'phone number', and so on. Notice that an entity can also be an attribute of another entity. In this case, 'address' is an entity that has attributes like 'ZIP code' and 'country', but 'person' is an entity that has 'address' as one of its attributes.

It is no coincidence that there is a very strong correlation between the terms we've defined in this section, and those we mentioned in the previous section.; you will see terms like 'fields' and 'attributes' used almost interchangeably in much of the literature. As is so often the case, the jargon is more confusing than the basic concepts it seeks to explain, so it's important to understand how these concepts relate to one another. One set of terms, like 'field', refers to the data in a database. The other set of terms, like 'attribute', refers to design concepts.



Beginning ASP. NET 2.0 and Databases
Beginning ASP.NET 2.0 and Databases (Wrox Beginning Guides)
ISBN: 0471781347
EAN: 2147483647
Year: 2004
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net