1 / 8

Principles of Database Design, Part II

Principles of Database Design, Part II. AIMS 2710 R. Nakatsu. Entity-Relationship (ER) Modeling. ER Modeling is the process of creating a graphical representation of the structure of the database by defining entities and relations among them.

hea
Download Presentation

Principles of Database Design, Part II

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. Principles ofDatabase Design, Part II AIMS 2710 R. Nakatsu

  2. Entity-Relationship (ER)Modeling ER Modeling is the process of creating a graphical representation of the structure of the database by defining entities and relations among them. • The ER model serves as the basic database blueprint. • The ER model can be used as a communication tool.

  3. ER Model Components • An entity is represented by a rectangle containing the entity’s name. An entity corresponds to a table in the relational environment. • A relationship is an association between entities. They are represented by diamond-shaped symbols. • Cardinality expresses the specific number of entity occurrences associated with the related entity.

  4. Relationships Types of Relationships • One-to-One e.g., one dean to one university one head-of-state to one country • One-to-Many e.g., one painter paints many paintings one customer places many orders • Many-to-Many e.g., students enroll in courses

  5. Cardinality in an ER Diagram Teaches 1 M Professor Class (1,1) (0,3) M N Enrolls Student Class (1,6) (0,N) Note: An N cardinality means that there is no limit.

  6. ER Diagram Problem • Acme Insurance Company is made up of several divisions. A claims adjuster is always assigned to one and only one division. • Claims adjusters work on several insurance claims. Each insurance claim is always worked on by a team of at least two but no more than five claims adjusters. Draw the ER Diagram for this situation. Note: a claims adjuster is an employee who investigates and processes insurance claims.

  7. Linking Tables: 1:M and 1:1 In a one-to-one and one-to-many link, you link a primary key in one table to a foreign key in another table. For a one-to-one relationship, the foreign key must be unique. In Access you set the Index value to Yes (No Duplicates). Referential Integrity: A condition in which a child table’s foreign key must have either a null entry or a matching entry in the related parent table.

  8. Linking Tables: Many-to-Many • For many-to-many relationships, you must create a separate intersection table to handle the relationship. • Access will not let you define a many-to-many relationship directly between two tables. • The primary key of the intersection is a composite primary key. • Two one-to-many relationships are created. Students Enroll Courses

More Related