MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004,

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

Data Modeling (CB 12) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Systems Development Life Cycle
Text-Book Chapters (7 and 8) Entity-Relationship Model
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
System Analysis - Data Modeling
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Chapter 3: Modeling Data in the Organization
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
Chapter 3: Modeling Data in the Organization
Information Resources Management January 30, 2001.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
1 Data Modelling Which data to include in the database.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Entity-Relationship Design
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Chapter 3: Modeling Data in the Organization
Entity-Relationship Model
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Chapter 5 Entity–Relationship Modeling
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 6 Structuring.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
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.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj InClass ER Examples.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 4 Mapping an ER model to tables © Akhilesh Bajaj,
MIS 7003 MIS Core Course The MBA Program The University of Tulsa Professor: Akhilesh Bajaj Introduction to Database Design All Slides in this presentation.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
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,
advanced data modeling
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Pree Thiengburanathum, CAMT, Chiang Mai University 1 Database System Modeling Data in the Organization October 31, 2009 Software Park, Bangkok Thailand.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, All Rights.
Chapter 3: Modeling Data in the Organization
Entity-Relationship Model
Tables and Their Characteristics
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity-Relationship Modeling
Database Modeling using Entity Relationship Model (E-R Model)
Chapter 3: Modeling Data in the Organization
Chapter 7: Entity-Relationship Model
Entity-Relationship Diagram (ERD)
Entity Relation Model Tingting Zhang.
Presentation transcript:

MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004, 2006, All Rights Reserved.

Review of Lecture 1 Entities and entity sets Attributes (simple / composite, single valued / multivalued, null valued, derived) Relationships and relationship sets Attributes of relationship sets Degree of relationship sets Cardinality of relationship sets

Goals Today Review concepts we did in the previous class Learn about existence dependencies (weak entity sets) Learn about keys of entity sets

Very Important Facts -We never ever,ever repeat anything in the ER diagram. -If we identify a “bunch of objects” each described by the same set of properties (or attributes) then it’s most likely an entity set -If it’s an entity set it will have a primary key. -If it’s a relationship set it will not have its own primary key. It may have some attributes, but it’s really just a “bunch of links” between objects in boxes (entity sets). -For cardinalities, we say “For each object on the other side of the diamond, how many minimum objects on this side is it linked to? And how many maximum?” -Ternary relationships are rare, and may lead to data redundancy. Be careful!

Existence Dependencies If the existence of entity x depends on entity y, then if y is deleted, x should also be deleted. E.g., the entity set course_sections is existence dependent on the entity set courses. So, each course_section is dependent on one and only one course for its existence. Thus, this section Fall2011A is existence dependent on the course MIS3053 (if that is how a course is defined). The course can have many sections Other examples of existence dependencies? In the above example, we say that course_sections is the weak entity set, while courses is the corresponding strong entity set. Another way to think: If we talk about the weak entity, we always HAVE to refer to the strong entity. If we say section Fall2011A, the question is: which course are we talking about? In a bank, if we say transaction id3, the question is: which account?

Rules for Determining if a Weak Entity Set is Appropriate 1. We cannot identify the weak entity without the primary key of the Strong entity 2. Delete the Strong Entity from its set ==> weak entities linked to that strong entity must be deleted 3. Each weak entity can have one and only 1 strong entity in the strong entity set. 4. A weak entity cannot switch from one strong entity to another in the strong entity set. ALL 4 of these points should be true.

Existence Dependencies The relationship set between a weak entity set and the corresponding strong entity set is shown differently in an ER diagram. The weak entity set is shown thus: The cardinality of the relationship set is always: Strong entity set Relationship set showing existence dependency Weak entity set 0:n OR 1:n1:1 Double Diamond Shows Existence Dependency

Example ER diagram of Professors, Students, Courses and Course_sections. Drawing ER diagrams with Weak Entity Sets

Keys are used to uniquely distinguish entities in an entity set and relationships in a relationship set. Keys are attribute(s) that distinguish entities and relationships. In the ER model, we shall only do primary keys. A primary key of an entity set is a set of attributes (usually one attribute) that uniquely distinguishes each entity in the entity set, such that no subset of this set of attributes is also a key. E.g., student_id can be designated the primary key of students. The only subset of this (set of) attributes is student_id itself. Other Examples? Keys in the ER model

A weak entity set has an attribute (or a set of attributes) that is a unique identifier. The unique identifier of the weak entity set is combined with the primary key of the corresponding strong entity set, to form the primary key of the weak entity set. E.g., the unique identifier of course_section is the section_id. There may be several sections with the same section_id (say, Fall2010A). To identify each section, we also need to know which course it belongs to. This information is got from the primary key value of the course which is the strong entity for the section. We shall not consider keys of relationship sets in this course. Keys in the ER model

A more complete university example. Drawing ER diagrams

Is it a real-world object? Is it likely to be in relationships with other objects? Is it described by a set of properties? E.g., Should telephone be a telephone_number attribute or an entity set Telephones, described by telephone_ number (and maybe other attributes like phone_type)? Design Issues: Entity Sets or Attributes?

One strategy is to model actions (verbs) as relationships and nouns as entities. E.g., Professors teach Courses. Design Issues: Entity Sets or Relationship Sets? Noun Entity Set Verb relationship set Noun Entity Set Another strategy is to ask yourself: Is this a real-world object, or does it represent a relationship between 2 real-world objects? E.g., Loan in a bank could be an entity set or a relationship set between customers and branches.