1 / 16

Fundamentals of Database Systems Fourth Edition El Masri & Navathe

Fundamentals of Database Systems Fourth Edition El Masri & Navathe. Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model. ER Model The ER model describes data as an entities , relationships , and attributes .

Download Presentation

Fundamentals of Database Systems Fourth Edition El Masri & Navathe

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. Fundamentals ofDatabase SystemsFourth EditionEl Masri & Navathe Chapter 3Data Modeling Using the Entity-Relationship (ER) Model

  2. ER Model • The ER model describes data as an entities, relationships, and attributes. • The ER model is one of the best-known tools for logical database design.

  3. ER Model Concepts • Entities and Attributes • Entities are specific objects or things in the mini-world that are represented in the database. For example the EMPLOYEE John Smith, the Research DEPARTMENT, the ProductX PROJECT • Attributes are properties used to describe an entity. For example an EMPLOYEE entity may have a Name, SSN, Address, Sex, BirthDate

  4. ER Model Concepts ( cont. ) • A specific entity will have a value for each of its attributes. For example a specific employee entity may have Name='John Smith', SSN='123456789', Address ='731, Fondren, Houston, TX', Sex='M', BirthDate='09-JAN-55‘ • Each attribute has a value set (or data type) associated with it – e.g. integer, string, subrange, enumerated type, …

  5. Types of Attributes • Simple Attribute • Each entity has a single atomic value for the attribute. For example, SSN or Sex. • Composite Attribute • The attribute may be composed of several components. For example, Address (Apt#, House#, Street, City, State, ZipCode, Country) or Name (FirstName, MiddleName, LastName). Composition may form a hierarchy where some components are themselves composite.

  6. Types of Attributes (cont.) • Multi-valued Attribute • An entity may have multiple values for that attribute. For example, Color of a CAR or PreviousDegrees of a STUDENT. Denoted as {Color} or {PreviousDegrees}. • Stored Attribute • An attribute which its value is stored by the user application.(e.g. Name).

  7. Types of Attributes (cont.) • Derived Attribute • An attribute which its value is Derived from another attribute. (For example, Age attribute can be derrived from DOB attribute). • Null-Values Attribute • In some cases a particular entity may not have an applicable value for an attribute. (For example Specialist attribute will have a value only if the student have a specialist).

  8. Entity Types, Entity Sets, Keys and Value sets • Entity Type: • Defines a collection (or a set) of entities that have the same attributes.( Example: Employee entity type in the company). • Entity Set: • Is the collection of all entities that refer to the same entity type.

  9. Key Attributes • An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type. For example, SSN of EMPLOYEE. • A key attribute may be composite. • Note: An entity may have no key attribute which is called in this case( Weak Entity). • Value Sets (Domain) of attribute: • The value set specifies the set of values that this attribute can have.

  10. SUMMARY OF ER-DIAGRAM NOTATION FOR ER SCHEMAS Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING RELATIONSHIP TYPE ATTRIBUTE Meaning KEY ATTRIBUTE MULTIVALUED ATTRIBUTE COMPOSITE ATTRIBUTE DERIVED ATTRIBUTE Symbol Symbol

  11. Relationships and Relationship Types • A relationshiprelates two or more distinct entities with a specific meaning. For example, EMPLOYEE John Smith works on the ProductX PROJECT. • Relationships of the same type are grouped or typed into arelationship type. For example, the WORKS_ON relationship type in which EMPLOYEEs and PROJECTs participate. • Thedegree of a relationship type is the number of participating entity types. Both MANAGES and WORKS_ON are binary relationships.

  12. Example relationship instances of the WORKS_FOR relationship between EMPLOYEE and DEPARTMENT EMPLOYEE WORKS_FOR DEPARTMENT e1 e2 e3 e4 e5 e6 e7  r1 r2 r3r4r5rr7  d1  d2  d3

  13. Example relationship instances of the WORKS_ON relationship between EMPLOYEE and PROJECT WORKS_ON EMPLOYEE PROJECT r1r2 r3r4r5r6r7r8 e1 e2 e3 e4 e5 e6 e7   p1  p2  p3

  14. Relationships and Relationship Types ( cont. ) • More than one relationship type can exist with the same participating entity types. • For example, MANAGES and WORKS_FOR are distinct relationships between EMPLOYEE and DEPARTMENT, but with different meanings and different relationship instances.

  15. Weak Entity Types • An entity that does not have a key attribute • A weak entity must participate in an identifying relationship type with an owner or identifying entity type • Entities are identified by the combination of: • A partial key of the weak entity type • The particular entity they are related to in the identifying entity type

  16. The Company ER Diagram

More Related