1 / 10

Database Fundamentals

Database Fundamentals. The Data Model: More About Relationships. Microsoft Enterprise Consortium: http://enterprise.waltoncollege.uark.edu Microsoft Faculty Connection/Faculty Resource Center http://www.facultyresourcecenter.com. Things you should know ….

teryl
Download Presentation

Database Fundamentals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database Fundamentals The Data Model: More About Relationships Microsoft Enterprise Consortium: http://enterprise.waltoncollege.uark.edu Microsoft Faculty Connection/Faculty Resource Center http://www.facultyresourcecenter.com

  2. Things you should know … • This presentation assumes you are already familiar with these terms: • Entity and entity type • Entity instance • Attribute • Identifier • Multivalued • Cardinality

  3. Relationships and cardinality • What do the relationships symbols really mean to us? Here are a few examples of how to read the minimum and maximum symbols. • A customer can have a minimum of zero orders. • A customer can have a maximum of many orders. • An order is for a minimum of one customer. • An order is for a maximum of one customer. CUSTOMER ORDER LOCATION EMPLOYEE

  4. Relationships • Based on maximum cardinality, a relationship falls into one of three types: • one-to-many • many-to-many • one-to-one one-to-many many-to-many CUSTOMER ORDER INVENTORY one-to-one LOCATION EMPLOYEE

  5. Maximum Cardinality • Keep in mind that the 3 relationship types (1-to-1, 1-to-many, and many-to-many) describe the maximum cardinality at both ends of a relationship. • It’s incorrect to read the minimum and maximum cardinality as “one-to-many”, for instance. This is NOT one-to-many This is many-to-many. ORDER INVENTORY This is NOT one-to-one This is one-to-many. CUSTOMER ORDER

  6. Degree of the relationship - Unary • The degree of the relationship refers to the number of entities in a single relationship. • The options are: unary, binary, ternary. • A unary relationship means a entity is related to itself. There is only one entity. Supervises Any one employee—Casey Wilson, for example—may be supervised by a minimum of zero employees. Any one employee—Casey Wilson, for example—may be supervised by a maximum of one employee. Any one employee—Carla Stevens, for example—may supervise a minimum of zero employees. Any one employee—Carla Stevens, for example—may supervise a maximum of many employees. EMPLOYEE Supervised by

  7. Degree of the relationship - Binary • A binary relationship means two entities are directly related. This is by far the most common one you see in a data model. Any one order—order ID # 4528, for example—may have a minimum of one inventory items in the order. Any one order—order ID # 4528, for example—may have a maximum of many inventory items in the order. Any one inventory item—Day-Glow Toothpaste, for example—may be sold in a minimum of zero orders. Any one inventory item—Day-Glow Toothpaste, for example—may be sold in a maximum of many orders. sold in ORDER INVENTORY has

  8. Degree of the relationship - Ternary • A ternary relationship means three entities are directly related. However, this three-way relationship between three entities can be decomposed into binary relationships. Therefore, we won’t spend more time on this term.

  9. We’ve learned more about relationships • In this presentation we’ve seen that a relationship is one-to-one or one-to-many or many-to-many. This information has important implications for how the database is actually built. • We’ve also seen what the “degree of the relationship” means. How many entities are involved in a direct relationship: unary (1 entity), binary (2 entity), or ternary (3 entity)?

  10. Resources • Microsoft Enterprise Consortium: http://enterprise.waltoncollege.uark.edu/mec.asp • The consortium provides teaching material and large databases donated by some major corporations. • Microsoft Faculty Connection—Faculty Resource Center http://www.facultyresourcecenter.com/ • A wide range of teaching resources are available.

More Related