ERD ENTITY RELATIONSHIP DIAGRAM

2y ago
15 Views
3 Downloads
1.32 MB
35 Pages
Last View : 22d ago
Last Download : 3m ago
Upload by : Mollie Blount
Transcription

Management Information SystemsERDENTITY RELATIONSHIP DIAGRAMM. Rasti-BarzokiWebsite: rasti.iut.ac.ir92-2

Management Information SystemsERDEntity Relationship Diagrams for Data Modelling An Entity-Relationship Diagram (ERD) shows how the data thatflows in the system is organised and used.2rasti.iut.ac.ir92-2

Management Information SystemsERDEntity Relationship Diagrams for Data Modelling The elements of an ERD are the following:– Entity –– Attributes –– Relationships – associations between entities.3rasti.iut.ac.ir92-2

Management Information SystemsERDExamplesRelationship name:writesBookAuthorAn author writes one or more booksA book can be written by one or more authors.4rasti.iut.ac.ir92-2

Management Information SystemsERDRelationship types and instances Example5rasti.iut.ac.ir92-2

Management Information SystemsERDRelationship types and instances Relationship instances6rasti.iut.ac.ir92-2

Management Information SystemsERDRelationship types and instances Example7rasti.iut.ac.ir92-2

Management Information SystemsERDERD Types of entity relationships and example of theirrepresentation:8rasti.iut.ac.ir92-2

Management Information SystemsERDERD Examples9rasti.iut.ac.ir92-2

Management Information SystemsERDERD Cardinalities Cardinality - The number of instances of entity B that can be associatedwith each instance of entity A.– Minimum Cardinality or Modality - The minimum number of instancesof entity B that may be associated with each instance of entity A.– Maximum Cardinality - The maximum number of instances of entity Bthat may be associated with each instance of entity A10rasti.iut.ac.ir92-2

Management Information SystemsERDEntity Relationship Diagrams for Data ModellingRelationships A one-to-one relationship (1:1) exists when the maximumcardinality for each entity in the relationship is 1. A one-to-many (1:N) relationship exists when the maximumcardinality on one side is 1 and the maximum on the other sideis many. A many-to-many (M:N) relationship exists when the maximumon both sides is many.11rasti.iut.ac.ir92-2

Management Information SystemsERDERD ExamplesA patient history isrecorded for one andonly one patient12A patient must haverecorded at least onehistory, and can havemanyrasti.iut.ac.ir92-2

Management Information SystemsERDERD ExamplesA project must beassigned to at leastone employee, andmay be assigned tomany13An employee can beassigned to any number ofprojects, or may not beassigned to any at allrasti.iut.ac.ir92-2

Management Information SystemsERDExamples One-to-one relationship(1:1): One instance in anentity (parent) refers to oneand only one instance in therelated entity (child)14rasti.iut.ac.ir92-2

Management Information SystemsERDExamples One-to-many relationship(1:M): One instance in anentity (parent) refers toone or more instances inthe related entity (child)15rasti.iut.ac.ir92-2

Management Information SystemsERDExamples Many-to-manyrelationship (M:N): existswhen one instance of thefirst entity (parent) canrelate to many instances ofthe second entity (child),and one instance of thesecond entity can relate tomany instances of the firstentity.16rasti.iut.ac.ir92-2

Management Information SystemsERDExamples17rasti.iut.ac.ir92-2

Management Information SystemsERDMultiple c.irEnrollsStudent92-2

Management Information SystemsERDExample19rasti.iut.ac.ir92-2

Management Information SystemsERDSteps to Construct ERD Like constructing DFDs and data dictionaries, the construction of ERDs isan iterative and evolutionary process that requires refinement as abetter understanding of the system to be developed is achieved.211.Identify entities – use DFDs to identify multiple instance entities.2.Add attributes – requires detailed analysis and perhaps use ofrequirements gathering techniques.3.Assign identifiers or Primary keys – Each entity type must have an attributeor set of attributes that distinguishes one instance from other instances ofthe same type.4.Foreign Keys - The attributes of a foreign key in one entity are theattributes of a primary key in another entity.5.Identify Relationships –rasti.iut.ac.ir92-2

Management Information SystemsERDERD Three Types of Relationships– One-to-one relationships (1:1) Each store is managed by a single employee and each store manager(employee) only manages a single store.– EMPLOYEE (1) manages STORE (1)– One-to-many relationships (1:M) A painter paints many different paintings, but each one of them is painted byonly that painter.– PAINTER (1) paints PAINTING (M)– Many-to-many relationships (M:N) An employee might learn many job skills, and each job skill might be learnedby many employees.– EMPLOYEE (M) learns SKILL (N)22rasti.iut.ac.ir92-2

Management Information SystemsERDEntity Relationship Diagrams for Data Modelling Implement One-to-One Relationships– In a relational database, one-to-one relationships between entities can beimplemented by merging the two tables/entities together. Implement One-to-Many Relationships– Place the primary key of the entity that can occur only once as a foreign keyin the entity that can occur many times. Implement Many-to-Many Relationships– In a relational database, many-to-many relationships between entities canbe implemented by creating a new entity that links the other two entitiestogether. In most cases, the primary key of the new entity consists of theprimary keys of the entities that it is relating together.– Spit it into two one-to-many relationships!23rasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M Detailed Steps1. Add intersection table2. Flip relationship lines around so “many” side facesthe intersection table3. Add primary keys from original tables as fields in theintersection table4. Assign a name the intersection table5. Add other relevant fields to intersection table ifnecessary25rasti.iut.ac.ir92-2

Management Information SystemsERDMany-to-Many Relationship (N:M)StudentNEnrollsJoeCourseMGS 351MGA 201MGQ 301MGF 301MGB 301SallyTomJean26Mrasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (Before) M:N - Add intersection table which includes primarykeys from both tablesStudentNEnrollsPerson #27MCourseCourse #rasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (After) Add intersection tableStudentCoursePerson #28Course #rasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (After) Flip relationship lines around so “many” side faces theintersection table1NNStudentCourseCourse #Person #291rasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (After) Add primary keys from original tables as foreign keyfields in the intersection table1NNStudentPerson #301CoursePerson #Course #Course #rasti.iut.ac.ir92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (After) Assign a name the intersection table1NRegistrationStudentPerson #31NPerson #Course #rasti.iut.ac.ir1CourseCourse #92-2

Management Information SystemsERDTransforming ERD to Tables – N:M (After) Add other relevant fields to intersection table n #32Person #Course #rasti.iut.ac.irCourse #92-2

Management Information SystemsERDWhat should be used as Primary Key in the intersectiontable?Composite Primary Key or n #33Person #Course #rasti.iut.ac.irCourse #92-2

Management Information SystemsERDSteps to Construct ERD Important guidelines when creating ERDs:– Use consistent labels and names– Avoid unnecessary attributes– Determine cardinality correctly34rasti.iut.ac.ir92-2

Management Information SystemsERDDFDs and ERDs DFDs and ERDs are both used to model systems, but they show twovery different perspectives on the system.– Entities on an ERD often correspond to data stores on a DFD– Attributes on an ERD usually correspond to data elements (listed in thedata dictionary) that make up the data store and data flows on a DFD– Relationships on an ERD do not correspond to processes on a DFD.35rasti.iut.ac.ir92-2

Management Information SystemsERDReferencesSystem Analysis and Design, Sixth Edition.Authors: Gary B. Shelly, Thomas J. Cashman and Harry J. RosenblattPublisher: SHELLY CASHMAN SEWIES.36rasti.iut.ac.ir92-2

Management Information Systems امام على عليه السالم : ح ب س ي ن وُصولُ المَرءِ اِلى ُكلِّ ما َيب َتغيهِ مِه طيبِ َعيشهِ وَ اَمهِ سِرِبِ وَ َس َعةِ رِزِقِ ُِ هِ َّتهِ وَ َس َعةِ ُخل هِق ّ جس ت ج گ خ س انسان ، با نيت خوب و اخالق خوب ِ ، ب تمام آنچه رد وى آن ا ت ، از زند ى وش من ح م ي م س ي و ا ت ط و روزى زياد ، د ت ى يابد .

A one-to-one relationship (1:1) exists when the maximum cardinality for each entity in the relationship is 1. A one-to-many (1:N) relationship exists when the maximum cardinality on one side is 1 and the maximum on the other side is many. A many-to-many (M:N) relationship exists

Related Documents:

1 IV. Entity Relationship Modeling 2 Entity-Relationship Model (ERM) Basis of an Entity-Relationship Diagram (ERD) A design technique Diagrams entities sets (with attributes) and the relationship between the entity sets. Recall previous definitions Entityrefers to the entity set and not a single entity occurrence E-R diagrams are the deliverablesof the

WIRING DIAGRAM DIRECTORY WARNING: Wiring direct to battery not recommended. Install actuator after ignition switch, or master power switch. Diagram 1 Diagram 2 Diagram 3 Diagram 4 Diagram 5 Diagram 6 Diagram 7 Diagram 8 Diagram 9 Diagram 10 Diagram 11 Diagram 12 Diagram 13 Diagram 14 Diagram 15 On/Off, 12VDC, 3-wire/3-pin, SPST On/Off, 12VDC, 3 .

Diagram” template in Visio is a logical model, not really a conceptual model. Do NOT use . Draw an Entity 8 The “ERD Stencil mini”.vssfile is loaded. Drag and drop the Entity shape to the . Draw a Relationship 10 Get a one-to-many (1:M) relationship shape and drop it on the canvas. DragFile Size: 1MB

Cardinality in ERD diagrams indicates the minimum and maximum number of entity occurrences permitted in a relationship for any one occurrence of an entity. An example of cardinality in an ERD diagram is the relationship between a fire test and

Structured analysis Object-oriented analysis System boundary Context diagram Use case diagram Functionality Data flow diagram Activity diagram Interaction diagrams Data Entity-relationship diagram Class diagram Object diagram Control State diagram State diagram Structured methods System as a set of nested processes accessing system data.

2.1 Entity-Relationship Diagram The concept for Entity-Relationship diagram (also called ER diagram) was introduced in a 1976 paper by Peter Chen six years after E.F. Codd published his seminal work defining the relational model of data. Chen's notation provided a way to graphically show relationships between data models.

A weak entity can be identified uniquely only by considering the primary key of another (owner) entity. Owner entity set and weak entity set must participate in a one-to-many relationship set (one owner, many weak entities). Weak entity set must have total participation in this identifying relationship set. Employees ssn name lot

Type A02 : Cable suffices This type comprises people with some limited interest in electronic technologies but who have neither the education nor income to become heavily engaged in using them. Many of this type are men who have recently retired or who are approaching retirement. A high proportion has access to cable television. Type A03 : Technology as fantasy This type contains many old .