Entity-Relationship Data Model CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan.

Slides:



Advertisements
Similar presentations
Temple University – CIS Dept. CIS616– Principles of Database Systems
Advertisements

Chapter 6: Entity-Relationship Model (part I)
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Text-Book Chapters (7 and 8) Entity-Relationship Model
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Databases Revision.
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
Lecture 2: Entity/Relationship modelling
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Chapter 2: Entity-Relationship Model (Continued)
Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
the Entity-Relationship Model
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Entity-Relationship Model
Chapter 6: ER – Entity Relationship Diagram
Chapter 2: Database Design and Entity-Relationship Model  Database Design  Entity Sets  Relationship Sets  Design Issues  Mapping Constraints  Keys.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan Chapter 6: Entity-Relationship Model.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts DB Schema Design: the Entity-Relationship Model What’s the use of the E-R model? Entity Sets.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
Entity – Relationship Model (E-R Model)
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Databases Illuminated Chapter 3 The Entity Relationship Model.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
Database and Information Retrieval System
Data Modeling Using the Entity-Relationship (ER) Data Model.
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
1 Entity Relationship Diagram. ER proposed by Peter Chen ER diagram is widely used in database design Represent conceptual level of a database.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Topic 3: ER – Entity Relationship Model (ERM) 6/12/
Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity-Relationship Data Model
COP Introduction to Database Structures
Entity-Relationship Model
Entity-Relationship Model
Entity Relationship Model
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity/Relationship Model
Chapter 6: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Entity Relation Model Tingting Zhang.
ER MODELING Instructor: SAMIA ARSHAD
Entity-Relationship Data Model
Presentation transcript:

Entity-Relationship Data Model CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan

Elements of E-R Model In the E/R model, the structure of data is represented graphically, as an “entity- relationship diagram,” using three Principal element types:  Entity Sets. An entity is an abstract object of some sort, and a collection of similar entities forms an entity set.  Attributes The properties of the entities in the set.  Relationship The connections among two or more entity Sets

Example of Elements of E-R Model  Entity Sets  Departments  Professors  Students  Administrators  Attributes  Name of Departments, Phone No., Address...  Name, SSN, Address of Professors...  Relationship  Students and Professors are under a certain department  Admin manage the campus/ departments

Example of the 3 elements in E/R Diagram

Classification of Constraints 1. Keys 2. Single-value constraints 3. Multi-valued constraints 4. Mapping Cardinalities and Participation Constraints

Key in the E/R Model Superkey is a set of one or more attributes that, taken collectively, for us to identify uniquely an item in the entity set. For example, customer-id is a superkey. Candidate key is a minimal superkey. For example, customer- name and customer-street is sufficient to distinguish among members of the customer entity set. Then {customer-name, customer-street } is a candidate key. Primary key denotes a candidate key that is chosen by the database designer as the principal means of identifying items within an entity set. the primary key should be chosen such that its attributes are never, or very rarely, changed. For example, Social-security numbers are guaranteed to never changed.

Single/Multi-valued attributes Single-valued attributes are attributes that only have a single value for a particular entity. Multi-valued attributes refers to items that are not singled-value and Null valued. For example, consider an employee entity set with the attribute phone-number. An employee may have zero, one, or several phone numbers; different employee may have different numbers of phones.

Mapping Cardinalities or Cardinality ratios Express the number of items to which another item can be associated via a relationship set Are most useful in describing binary relationship sets. For a binary relationship set R between entity sets A and B, the mapping cardinality must be one of the following:  One to One  One to Many  Many to One  Many to Many

Participation Constraints The participation of an entity set E in a relationship set R is said to be total, if every item in E participates in at least one relationship in R. If only some items in E participate in relationship R, the participation of entity set E in relationship R is said to be partial.

Weak Entity Sets There is an occasional condition in which an entity set’s key is composed of attributes some or all of which belong to another entity set. Such an entity set is called a weak entity set.

Discriminator The discriminator of a weak entity set is a set of attributes that allows this distinction to be made. For example, the discriminator of a weak entity set payment is the attribute payment-number, since, for each loan a payment number uniquely identifies one single payment for that loan. The discriminator of a weak entity set is also called the partial key of the entity set.

Requirements for Weak Entity Sets We cannot obtain key attributes for a weak entity set indiscriminately. Rather, if E is a weak entity set then its key consists of:  Zero or more of its own attributes, and  Key attributes from entity sets that are reached by certain many-one relationship from E to other entity sets. These many-one relationship are called supporting relationships for E.

Discriminator (cont.) Note: although each payment entity is distinct, payments for different loans may share the same payment-number. Thus, payment entity set does not have a primary key; it is a weak entity set. The primary key of a weak entity set is formed by the primary key of the identifying entity set, plus the weak entity set’s discriminator.

Identifying a Weak Entity Type A Weak entity type doesn’t have a primary key. If X is a weak entity type and Y is the entity type on which X is dependent. We form a primary key for X by combining the primary key of Y which one or more attributes, called discriminator or partial key, from X. In an E/R Diagram, a partial key is usually dash- underlined. e.g., primary key for DEPENDENT: {Employee No., DName}.

* Doted-line = double-line *

References Peter Chen’s website: Database Systems: A First Course, J.D. Ullman & J. Widom db.stanford.edu/~ullman/fcdb.html db.stanford.edu/~ullman/fcdb.html p157AL4.ppt p157AL4.ppt p157AL5Enhanced%20ER-diagram.ppt