04.06.2015 Views

Database Modeling and Design

Database Modeling and Design

Database Modeling and Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.2 Transformation Steps 103<br />

there are no common attributes <strong>and</strong> no integrity constraints to maintain.<br />

The main function of aggregation is to provide an abstraction to<br />

aid the view integration process. In UML, aggregation is a composition<br />

relationship, not a type relationship, which corresponds to a weak entity<br />

[Muller, 1999].<br />

5.1.5 Multiple Relationships<br />

Multiple relationships among n entities are always considered to be completely<br />

independent. One-to-one, one-to-many binary, or binary recursive<br />

relationships resulting in tables that are either equivalent or differ<br />

only in the addition of a foreign key can simply be merged into a single<br />

table containing all the foreign keys. Many-to-many or ternary relationships<br />

that result in SQL tables tend to be unique <strong>and</strong> cannot be merged.<br />

5.1.6 Weak Entities<br />

Weak entities differ from entities only in their need for keys from other<br />

entities to establish their uniqueness. Otherwise, they have the same<br />

transformation properties as entities, <strong>and</strong> no special rules are needed.<br />

When a weak entity is already derived from two or more entities in the<br />

ER diagram, it can be directly transformed into a table without further<br />

change.<br />

5.2 Transformation Steps<br />

The following list summarizes the basic transformation steps from an ER<br />

diagram to SQL tables:<br />

• Transform each entity into a table containing the key <strong>and</strong> nonkey<br />

attributes of the entity<br />

• Transform every many-to-many binary or binary recursive relationship<br />

into a table with the keys of the entities <strong>and</strong> the<br />

attributes of the relationship<br />

• Transform every ternary or higher-level n-ary relationship into a<br />

table<br />

Now let us study each step in turn.<br />

@Spy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!