DBMS ER model-2 Week 6-7.

Slides:



Advertisements
Similar presentations
Database Design: ER Modelling (Continued)
Advertisements

Data Modeling (CB 12) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
CSC271 Database Systems Lecture # 22. Summary: Previous Lecture  Applying Database SDLC on DreamHome  Database planning  System definition  Requirements.
Systems Development Life Cycle
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Pertemuan Entity Relationship Diagram
System Analysis - Data Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Entity-Relationship Model
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
Methodology: Conceptual Databases Design
© Pearson Education Limited, Chapter 9 Logical database design – Step 1 Transparencies.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Entity Relationship Modeling
Database Design – Lecture 4 Conceptual Data Modeling.
Data Modeling Using the Entity-Relationship (ER) Data Model.
1 Database Systems Entity Relationship (E-R) Modeling.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
CSC271 Database Systems Lecture # 23. Summary: Previous Lecture  Database design using ER modeling  Concepts of ER model  Entities  Relationships.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
IS 4420 Database Fundamentals Chapter 3: Modeling Data in the Organization Leon Chen.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Data Modeling Using the Entity- Relationship (ER) Model
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
Conceptual Design & ERD Modelling
TMC2034 Database Concept and Design
Entity-Relationship Modeling
Overview of Entity‐Relationship Model
Conceptual Database Design
Entity-Relationship Modeling
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Presentation transcript:

DBMS ER model-2 Week 6-7

Structural constraints Apply on the entity types that participate in a relationship. Come from the real world constraints in client’s domain. We focus on binary relationships which have two participating entity types. Three types of binary relations one-to-one – 1:1 one-to-many – 1:* many-to-many - *:*

One to One relationships 1:1 For example, Staff Manages Branch Meaning At least one and a maximum of onemanager manages a branch. A member of manager manages zero or one branch. manager manages Bank branch (1,1) (0,1)

Occurrence diagram 1:1 m1 b1 m2 b2 m3 b3 m4 b4 m5 b5 m6 manager Bank branch

One to many relationships 1:N For example, Staff oversees PropertyForRent Meaning At least zero and many of one students follows a course A student follows maximum or minimum 1 course. follows Student course (0,N) (1,1)

Occurrence diagram 1:N s1 s2 c1 s3 c2 s4 c3 s5 c4 Student Course

Many to many relationships N:M For example, NewsPaper Advertises PropertyForRent Meaning At least one and a maximum of many subject teach by a teacher A subject tech by one or many teacher. Teach by subject teacher (1,M) (1,N)

Occurrence diagram M:N s1 t1 s2 t2 s3 t3 s4 t4 s5 t5 subject Teacher

Multiplicity Range – Min..Max Used to specify the number of possible occurrences of each participating entity type in a relationship. Multiplicity range is for this specification has two parts Min Max For example, for a multiplicity range of 0..1 Min = 0 Max = 1 Max of a multiplicity range denotes Cardinality Min of a multiplicity range denotes Participation

Enhanced ER Modelling ER modelling does not capture all the semantics of client’s domain, such as ‘ISA’ (‘is a’) relationship or specialization-generalization ‘Manager’ entity type ‘is a’ subentity of ‘Staff’ entity. ‘HASA’ (‘has a’) relationship or ‘is-part-of’ relationship or aggregation A relationship between the ‘whole’ and the ‘part’. Branch (whole) Has Staff (part) Composition is a special form of aggregation – ‘part’ is strongly owned by the ‘whole’. Enhanced ER models represent the above relationships Therefore capture client’s domain more comprehensively.

Diagrammatic Representation of ‘ISA’ relationship name position staffNo salary Staff Specialization/generalization indicator ISA Manager & supervisor Is of the type Staff Manager Supervisor bonus mgrStartDate

Summary So far …. ER modelling technique helps us to model data from any domain The main components are Entities Relationships Attributes Multiplicity constraints Superclass-subclass relationships Diagrammatic notations for all the above We need to now learn how to use this knowledge to actually model data from a particular domain We use a step-by-step procedure as described next This means we build EER models incrementally

Top-down approach for ERDs Identify entity types. Identify relationship types. Identify and associate attributes with entity or relationship types. Determine attribute domains. Determine candidate, primary and alternate key attributes. Validate conceptual model against user transactions. Review conceptual data model with user.

Identify entity types No well defined procedure Take a very selective view of the world Determine the main concepts in the domain about which the database has to store data. In the user requirement specification, identify Nouns and noun phrases Places, people and concepts Objects with independent existence Watch out for synonyms and homonyms Draw the entity types in the ER diagram. Document entity details in the data dictionary.

Identify relationship types Determine the relationships among the entity types identified in the previous step Relationships may open up new entity types!! In the user requirement specification, identify Verbs and verb groups (verbal expressions) First identify binary relationships. Only then identify complex relationships. Check the possibility of a relationship between each pair of entity types Time consuming but possible on smaller design problems. Determine the structural constraints. Draw the relationship types in the ER diagram. Add information about structural constraints to the ER diagram. Document relationship details in the data dictionary.

Identify and associate attributes (I) For each entity/relationship identified in the previous steps Determine required information about that entity/relationship. if an attribute is composite If the user wants to access parts of the composite attribute Represent it in terms of the constituent simple attributes. If an attribute is multi-valued Model it as a separate entity at this stage Or Leave it alone at this stage - logical design process will anyway model it as a separate relation.

Identify and associate attributes (II) Alternatively make a list of attributes from user requirements specification. Tick them off the list as you associate them with an entity/relationship. When attributes appear to be associated with more than one entity/relationship, either have a potential relationship between the entity types Or have a case for applying generalization/specialization Add attribute information to the ER diagram and data dictionary.

Specify Structural Constraints A relationship has some participating entities E.g. Staff manage Branch has Staff and Branch as the participating entities The main task in relationship specification is to specify structural constraints (min-max constraints) on the participating entities. E.g. Many Staff might manage a Branch These constraints specify how many instances of data from one participating entity correspond to one instance from the other participating entity. E.g., One Branch may have many Staff

Guidelines for identifying primary key The candidate key with the minimal set of attributes The candidate key that is least likely to have its values changed The candidate key with fewest characters The candidate key with smallest maximum values The candidate key that is easiest to use from the user’s point of view

Putting it all together So far we have learnt step-by-step procedure for collecting data models of components of the conceptual design. These component data models need to be put together into an ER diagram showing the overall data model for the domain.

try “A football club has a name and a ground and is made up of players. A player can play for only one club and a manager, represented by his name manages a club. A footballer has a registration number, name and age. A club manager also buys players. Each club plays against each other club in the league and matches have a date, venue and score.”

try! Patients are treated in a single ward by the doctors assigned to them. Usually each patient will be assigned a single doctor, but in rare cases they will have two. Heathcare assistants also attend to the patients, a number of these are associated with each ward.”

Try! “A lecturer, identified by his or her number, name and room number, is responsible for organising a number of course modules. Each module has a unique code and also a name and each module can involve a number of lecturers who deliver part of it. A module is composed of a series of lectures and because of economicconstraints and common sense, sometimes lectures on a given topic can be part of more than one module. A lecture has a time, room and date and is delivered by a lecturer and a lecturer may deliver more than one lecture. Students, identified by number and name, can attend lectures and a student must be registered for a number of modules. We also store the date on which the student first registered for that module. Finally, a lecturer acts as a tutor for a number of students and each student has only one tutor.”