1 / 11

Tutorial 3

Tutorial 3. This tutorial went through how to convert multiplicity numbering used in UML modelling to ERD, and vice versa. In the exam and assignments, use ERD please! We also discussed how to map ERD into schema using Assignment 2 Q2 as an example. Multiplicity of Relationship. m .. n

calix
Download Presentation

Tutorial 3

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. Tutorial 3

  2. This tutorial went through how to convert multiplicity numbering used in UML modelling to ERD, and vice versa. • In the exam and assignments, use ERD please! • We also discussed how to map ERD into schema using Assignment 2 Q2 as an example.

  3. Multiplicity of Relationship • m .. n • 0 .. n • m .. * • 0 .. * (*) • 1 .. 1 (1) • At least m, at most n (m .. n) • Sometimes, you may have (0 .. n), which means the two entities does not have to be related all the time. • * indicating any number, at least m is (m .. *). • * is also a short hand for (0 .. *). • 1 is a short hand for (1 .. 1). • Default is 1 to 1.

  4. Entities participate at most once in the relationship would specify key constraints, represented with an arrow. • Always pointing from the entities to relationships. • In the case of M-1, it is always from Many table pointing to the relationship. ERD • One to One • Many to One • Many to Many • Complete (full participation) • Complete 1-1 • Complete M-1 • Complete M-M R One One key R Many One R Many Many Entities participate at least once in the relationship would specify full participation constraints. R One One R Many One R Many Many

  5. Types of relationships - UML • One to One • Many to One • Many to Many • Complete (full participation) • Complete 1-1 • Complete M-1 • Complete M-M Entity_A Entity_B relationship 0 .. 1 Attribute1:PK Attribute2 …. 0 .. 1 Attribute1:PK Attribute2 …. * 0 .. 1 * * Entity_A Entity_B relationship 1 Attribute1:PK Attribute2 …. 1 Attribute1:PK Attribute2 …. 1 .. * 1 .. 1 1 .. * 1 .. *

  6. Question – Assignment 2 Q2, Q3 • Draw and Entity-Relationship Diagram for the following scenario, a real estate firm employs personnel and lists for sale properties that have owners. The following describes the organisation: • The firm is made up of several sales offices in various locations. Attributes of the sales office include an office number (identifier) and a location. • Each sales office has one or more employees. Each employee has an employee id (identifier) and a name. Each employee can only be assigned to one sales office. • Each sales office has one of its assigned employees designated as the manager of that office. • The firm lists properties for sale. Each property has a property id (identifier), and location information consisting of a street address, the city, state, and post code. • Each property is exclusively listed with one sales office. Each sales office may have many properties listed, including none. • Each property has one or more owners. The percentage of ownership is an attribute of the relationship between an owner and the property. Each owner has an owner id (identifier) and a name. An owner may own one or more properties.

  7. Attribute or Entity?

  8. Model Answer Entities participate at least and at most once – exactly once in the relationship are good candidates for the relationship to merge into as single tables.

  9. Direct Translations – 8 Tables (both entities are relationships)After considering key and participation constraints – 5 Tables

  10. List relationship Works-in relationship Manages relationship

More Related