CS34311 The Entity- Relationship Model Part III..

Slides:



Advertisements
Similar presentations
Conceptual Design using the Entity-Relationship Model
Advertisements

Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
CS34311 The Entity- Relationship Model Part 4.. CS34312 Coming up with a good design for your application Guidelines via examples.
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.) –What are the entities.
CS34311 Translating ER Schema to Relational Model.
System Analysis - Data Modeling
Murali Mani The Relational Model. Murali Mani Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still.
The Entity- Relationship Model CS 186 Fall 2002: Lecture 2 R &G - Chapter 2 A relationship, I think, is like a shark, you know? It has to constantly move.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
CS34311 The Entity- Relationship Model. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Chapter 2: Entity-Relationship Model (Continued)
Modeling Your Data Chapter 2. Part II Discussion of the Model: Good Design/ Bad Design?
Murali Mani The Entity- Relationship Model. Murali Mani Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
1 The Entity-Relationship Model Chapter 2. 2 Database Design Process  Requirement collection and analysis  DB requirements and functional requirements.
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
Transforming ER & EER diagrams into Relations (Chapter 9)
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Conversion from ER diagram to relational model
Entity-Relationship Model Ch. 3
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.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
IS 475/675 - Introduction to Database Design
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Database Design 3: Advanced Data Modeling Concepts CS 320.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
CS3431: C-Term The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
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 Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
CS34311 Translating ER Schema to Relational Model.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-2.
CS34311 The Entity- Relationship Model Part I.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
The Entity-Relationship Model
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-3.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
Modeling Your Data Chapter 2 cs5421. Part II Discussion of the Model: Good Design/ Bad Design? cs5422.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity- Relationship Model (Continued)
CS3431-B111 The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
CS3431: C-Term Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
CS34311 Translating ER Schema to Relational Model.
Chapter 5 Understanding Entity Relationship Diagrams.
COP Introduction to Database Structures
Translating ER Schema to Relational Model
Translating ER Schema to Relational Model
EECS 647: Introduction to Database Systems
Modeling Your Data Chapter 2 cs542
The Entity-Relationship Model
Guidelines Towards Good Design
The Entity-Relationship Model
Entity Relationship Diagrams
Database Systems Instructor Name: Lecture-9.
Relational Database Design by ER- and EER-to-Relational Mapping
The Entity-Relationship Model
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

CS34311 The Entity- Relationship Model Part III.

CS34312 Cardinality Constraints (1) Each Supplier supplies at least some Product to some Consumer (2) A Consumer gets a Product from only one and same Supplier (3) A Supplier supplies some Product to at least two Consumers (4) Each Supplier supplies exactly two different Products

CS34313 Cardinality Constraints

CS34314 ER Model Constraints Summary Key Constraints Cardinality Constraints Expressed using (min, max) Binary relationship types are called: 1:1 1:many many:many

CS34315 An Application Example Courses offered in CS Dept, WPI, in B term What entity types? Student, Professor, Course, GradStudent Attributes and key constraints for entity types ? What relationship types? Prof teaches courses, students take courses, graduate students are TA-ing for courses Cardinality for relationship types ?

CS34316 Possible Solution Student sNumber sName Course cNumber title Is Taking Professor pNumber pName Is Teaching GradStudent gSNumber gSName Is TAFor

CS34317 Possible Solution

CS34318 More ER Modeling Constructs: ISA Relationship Types Similar to “subclass” concept in OO languages Students can be UGStudents or GradStudents UGStudents take Classes GradStudents are TAs for Classes GradStudents are advised by Professors

CS34319 Student GradStudent Course sName sNumber ISA UGStudent Is TAFor cNumbertitle Is Taking programyear Professor Is AdvisedBy pNumberpName

CS343110

CS ISA Relationship Student sNamesNumber ISA UGStudent year Questions: 1.Keys for supertypes and subtypes ? 2.Attributes of types? 3.Cardinalities on relationship?

CS ISA Relationship Notes: Key for subtype is same as key for supertype Subtypes can have additional attributes Implicit 1:1 relationship

CS Student GradStudent sName sNumber ISA UGStudent programyear Professor Is AdvisedBy pNumberpName (1, 1) (0, *) Disjoint/Overlapping: UGStudent can (cannot) also be a GradStudent, or vice versa Covering/Virtual: Students must be either UGStudent or GradStudent, or both Is-A Relationship Constraints

CS Weak Entity Types The Courses offered by a Dept are identified by Cnumber Course is weak entity type Its identifying relationship is Offers Its identifying entity type is Dept Note: Cardinality of weak entity type in a identifying relationship type is (1, 1)

CS Summary of ER Structures Entity Types Relationship types – binary, ternary, n-ary. recursive Attributes For entity types or relationship types Simple, composite or multi-valued Constraints – key, cardinality Roles of entity types in a relationship type ISA relationship types Weak Entity Types – identifying relationship type, identifying entity type

CS Coming up with a good design for your application Guidelines via examples

CS Towards a Good Design Convey “real” application requirements Utilize meaningful names Try simpler construct first Avoid redundancy Be as precise as possible (constraints) Don’t over specify (limits input)

CS Coming up with a good design for your application Give good names to entity types, relationship types, attributes and roles

CS Good Design: Attribute or entity type? Should we represent something as an attribute or entity type? (or) How should dept be represented?

CS KISS Principle: Keep It Simple Stupid Do not introduce unnecessary entity types (or) Is Entity type Contract Un-necessary ??

CS Good Design: Determine correct cardinality constraints (or)

CS Good Design: Try to avoid redundancy Any Redundant attribute ? Attribute dNum is redundant

CS Good Design: Try to Avoid redundancy Any Redundant relationship type ? Relationship Type IsObtainedBy is redundant

CS Towards a Good Design Convey “real” application requirements Utilize meaningful names Try simpler construct first Avoid redundancy Be as precise as possible (constraints) Don’t over specify (limits input)