Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000
Saturday, January 24th, 2009Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000 71 cation and are therefore separated away in a separate entity. A one- to-one relationship is usually drawn on an ER diagram as a line with both ends having dots. One-to-Many One-to-many relationships exist when a single instance of an entity (the parent entity) relates to many instances of another entity (the child entity). One-to-many relationships are the most common relationships in the real world. For example, a customer may have many orders, and a manufactured product may have many components. A one-to-many relationship is usually drawn on an ER diagram as a line with the child end having a dot. The child end is a crow s foot in Chen and IE data models. Many-to-Many This type of relationship occurs when many rows or data elements in an entity are associated with many rows or data elements in another entity. For example, a many-to-many relationship occurs between the Trainee and Course entities. Many Trainees can enroll in a single course, and one trainee can be enrolled in numerous courses. This type of relationship is not uncommon in the real world. However, SQL Server doesn t actually directly implement many-to-many relationships. A many-to-many relationship is implemented using three entities. The two main entities are connected together using a third entity. The third entity contains keys and interrelationship information. Each entity is connected to the new entity as a one-to-many relationship. To discover the cardinality of a relationship, you look at the correlation between the entities. For example, a Trainee may take many Courses, and a Course may have many Trainees. The problem isn t SQL Server not implementing many-to-many relationships, but that relational databases in general cannot directly support this kind of relationship. Therefore, it is a combination of two, one-to-many ties. Identifying Relationships Remember, entities are the nouns in the model; akin to this, relationships are the verbs. This verb/noun concept is a key factor in
For high quality website hosting services please check cheap web hosting website.