ER example : movie & category

Slides:



Advertisements
Similar presentations
THE EXTENDED ENTITY RELATIONSHIP MODEL (EERM)
Advertisements

Basic notation for supertype/subtype relationships
Entity Relationship (E-R) Modeling Hachim Haddouti
Advanced Data Modeling
Entity Relationship (ER) Modeling
1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Advanced Data Modelling
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
Entity Relationship (E-R) Modeling
Chapter 4 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Use of supertype/subtype relationships Use of supertype/subtype.
Information Resources Management February 13, 2001.
Data Modeling Advanced Concepts.
Mapping from E-R Model to Relational Model Yong Choi School of Business CSUB.
IS 4420 Database Fundamentals Chapter 4: The Enhanced ER Model and Business Rules Leon Chen.
Chapter 4 Entity Relationship (E-R) Modeling
Chapter Five Data Modeling with the Entity-Relationship Model.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
1 Chapter 4 Enhanced E-R Model. 2 Supertypes and Subtypes Subtype: A subgrouping of the entities in an entity type which has attributes that are distinct.
Chapter 3: The Enhanced E-R Model
1 Chapter 4: The Enhanced ER Model and Business Rules.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 The Relational Model (Advanced)
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Mapping from Data Model (ERD) to Relational Model Yong Choi School of Business CSUB.
Converting ER model Into Relational Table
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.
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
Mapping from Data Model (ERD) to Relational Model
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
CS 370 Database Systems Lecture 9 The Relational model.
Entity – Relationship Model (E-R Model)
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
1 The Enhanced Entity Relationship Diagrams (E-ERDs)
Databases Illuminated Chapter 3 The Entity Relationship Model.
Entity Relationship Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Ninth Edition
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: The Enhanced E-R Model Modern Database Management 9 th Edition Jeffrey A. Hoffer,
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: THE ENHANCED.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
The Enhanced E-R Model and Business Rules
LECTURE 4: Chapter 4: The Enhanced E-R Model
Conceptual Design & ERD Modelling
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: Part B Logical Database Design and the Relational Model
Entity Relationship (E-R) Modeling
Entity Relationship Diagrams
Database Management System 1 (ITED123A)
CHAPTER 3: THE ENHANCED E-R MODEL
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Chapter 5 Advanced Data Modeling
Database Management system
Entity Relationship (ER) Modeling
CS4222 Principles of Database System
Presentation transcript:

ER example : movie & category M_id Title Cat_id 10001 Forest Gump C102 10002 Iron man C103 10003 Ender Game C101 Cat_id Type C101 Sci Fi C102 Drama C103 Action

If we have a new category, we can insert into category. M_id Title Cat_id 10001 Forest Gump C102 10002 Iron man C103 10003 Ender Game C101 Cat_id Type C101 Sci Fi C102 Drama C103 Action C104 Cartoon

If we have a new category, we can insert into category. If we change category type, we can do in category. 1 2 M_id Title Cat_id 10001 Forest Gump C102 10002 Iron man C103 10003 Ender Game C101 Cat_id Type C101 Sci Fi C102 Drama C103 Action & Advenger C104 Cartoon 2 1

Maintaining History of Time-Variant Data Normally, existing attribute values are replaced with new value without regard to previous value Time-variant data: Values change over time Must keep a history of data changes Keeping history of time-variant data equivalent to having a multivalued attribute in your entity Must create new entity in 1:M relationships with original entity New entity contains new value, date of change

Fan Traps Design trap occurs when relationship is improperly or incompletely identified Represented in a way not consistent with the real world Most common design trap is known as fan trap Fan trap occurs when one entity is in two 1:M relationships to other entities Produces an association among other entities not expressed in the model

Supertype/subtype relationships

Disjoint and Overlapping Constraints Disjoint subtypes Also called nonoverlapping subtypes Subtypes that contain unique subset of supertype entity set Overlapping subtypes Subtypes that contain nonunique subsets of supertype entity set

Overlapping subtypes

Completeness Constraint Partial completeness Symbolized by a circle over a single line Some supertype occurrences are not members of any subtype Total completeness Symbolized by a circle over a double line Every supertype occurrence must be member of at least one subtype

Transforming the ER diagram into relation Schema diagram The steps: Map regular entities Map weak entities Map binary relationships Map unary relationships Map ternary relationships Mapping Supertype/subtype relationships

Mapping a composite attribute

Looks like this using relational schema Relational schema diagram : Relational schema : CUSTOMER( Custome_ID, Customer_Name, Street, City, State, Zip )

The 1:M Relationship Between PAINTER and PAINTING

Mapping a 1:M relationship

Looks like this using relational schema diagram

Mapping a binary 1:1 relationship Some nurse is not in charge for care center  (0,1) All care centers must have a nurse to be in charge  (1,1) So,put FK on (0,1) care center

Looks like this using relational schema diagram

Mapping an M:M relationship

Mapping an M:M relationship

Looks like this using relational schema diagram

Mapping weak entities

Looks like this using relational schema diagram

Mapping Supertype/subtype relationships

Looks like this using relational schema diagram

Try this