CS34311 The Entity- Relationship Model. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Week 5 Relational Database Design by ER- -to-Relational Mapping.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 541: Database Systems S. Muthu Muthukrishnan. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.)  What are the entities.
1 Key Constraints Consider Works_In: An employee can work in many departments; a dept can have many employees. In contrast, each dept has at most one manager,
The Entity-Relationship (ER) Model
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
The Entity-Relationship Model
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Database Management Systems 3ed, 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.
Data Modeling is an Analysis Activity
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
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.
Murali Mani The Relational Model. Murali Mani Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
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.
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
Copyright © 2004 Pearson Education, Inc.. Chapter 3 Data Modeling Using the Entity-Relationship Model.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
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,
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
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.
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.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Entity-Relationship Model Ch. 3
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Christoph F. Eick: Designing E/R Diagrams 1 The Entity-Relationship Model Chapter 3+4.
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:
CS3431: C-Term The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
Chapter 3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
09/03/2009Lipyeow Lim -- University of Hawaii at Manoa 1 ICS 321 Fall 2009 Introduction to Database Design Asst. Prof. Lipyeow Lim Information & Computer.
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.
Databases Illuminated Chapter 3 The Entity Relationship Model.
CS34311 Translating ER Schema to Relational Model.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data 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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
CS34311 The Entity- Relationship Model Part III..
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.
Mapping ER Diagrams to Tables
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.
The Relational Model Lecture #2 Monday 21 st October 2001.
Translating ER Schema to Relational Model
Modeling Your Data Chapter 2 cs542
The Entity-Relationship Model
The Entity-Relationship Model
Entity Relationship Diagrams
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

CS34311 The Entity- Relationship Model

CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual Schema Logical Schema Physical Schema

CS34313 Conceptual Design What is Conceptual Design? Concise representation of our DB application requirements Why Conceptual Design ? It helps us to understand application requirements better It helps us to communicate our understanding of application It helps us to come up with a ‘good’ design

CS34314 Conceptual Design Conceptual Models ER (Entity Relationship) Model, UML (Unified Modeling Language), ORM (Object Role Modeling), etc ER Model Structures: entities and relationships Constraints An ER schema is represented as an ER diagram.

CS34315 ER Model: Entity Types and Attributes Entity: “Object” Entity Type: “Class” Attribute: property of an entity, has a domain In ER diagrams Entity Type  rectangle Attribute  Oval. Entity Type Student with attributes (sNumber, sName, sAge)

CS34316 ER Example Consider DB instance with 3 students (1, Joe, 21), (2, Mary, 20), (3, Emily, 20)

CS34317 ER Model: Complex Attributes Composite Attribute: addressMultivalued Attribute: major Student entity type with all its attributes

CS34318 ER Model: Relationship Types Relationship: Association between entities Relationship Type: Class of relationships Representation: Use a diamond shape Relationship type HasTaken to represent Courses taken by Students

CS34319 ER Model: Relationship Types with Attributes Relationship HasTaken has an attribute project which is the project the Student did for the Course

CS Example: Relationship Instances students {Hong, Song}, courses {DB1, DB2}, and relationships {(Hong, DB1, 98), (Song, DB1, 99), (Hong, DB2, 97)}

CS More relationship types Example : Model the relationship Supplier supplies Products to Consumers for a given price at a given quantity. How would you model this ?

CS More relationship types Model the relationship Supplier supplies Products to Consumers Could we make two binary (or three binary) relationships instead?

CS Binary vs. Ternary Relationships What about following binary relationships : S “can-supply” P, C “needs” P, and C “deals-with” S No combination of binary relationships is an adequate substitute: Together 3 binary relationships don’t imply that C has agreed to buy P from S. Also, how could we record qty and price?

CS Recursive Relationship Types and Roles Recursive relationship type : Part-Subpart Roles: There are Parts that play the role of superPart There are Parts that play the role of subPart

CS ER Model so far Structures Entity Types Relationship Types Binary, ternary, n-ary Recursive Attributes For entity types and relationship types Simple, composite, multivalued Roles

CS ER Model: Key Constraints How : Underline the key attribute/attributes Key for Student is sNumber Key for Movie is Note: We can represent key for an entity type consisting of more than 1 attribute (e.g.: Movie) We cannot represent multiple keys for an entity type (eg: key for Student can be either sNumber or sName)

CS ER Model: Cardinality Constraints How : Expressed using (min, max) Student can take >= 2 and <= 3 Courses Course can have >= 0 and <= * (infinity) Students min and max are non-negative integers max > min

CS Cardinality Constraints 1:1 relationship type: A Dept has exactly one Manager, A Person can manage at most one Dept Person pNumber pName Dept dNumber dName Manages

CS Cardinality Constraints 1:1 relationship type: A Dept has exactly one Manager, A Person can manage at most one Dept

CS Cardinality Constraints 1:1 relationship type: A Dept has exactly one Manager, A Person can manage at most one Dept

CS Cardinality Constraints 1:many (1:n) relationship type: A Person works for exactly one Dept, A Dept can have any number of Persons Person pNumber pName Dept dNumber dName Works For

CS Cardinality Constraints 1:many (1:n) relationship type: A Person works for exactly one Dept, A Dept can have any number of Persons

CS Cardinality Constraints 1:1 relationship type: A Dept has exactly one Manager, A Person can manage atmost one Dept 1:many (1:n) relationship type: A Person works for exactly one Dept, A Dept can have any number of Persons

CS Cardinality Constraints many:many (m:n) relationship type: A Person works for one or more Depts, A Dept can have any number of Persons Person pNumber pName Dept dNumber dName Works For

CS Cardinality Constraints many:many (m:n) relationship type: A Person works for one or more Depts, A Dept can have any number of Persons

CS Cardinality Constraints for n-ary relationships A Supplier supplies at least one Product to some Consumer Supplier sName sLoc Consumer cName cLoc Supply price Product pName pNumber qty

CS Cardinality Constraints for n-ary relationships A Supplier supplies at least one Product to some Consumer

CS Cardinality Constraints for n-ary relationships What about the following constraints : (1) A Consumer gets a Product from only one Supplier (2) Each Supplier supplies exactly 2 Products

CS Cardinality Constraints for Recursive Relationships A Part can be subpart of one superPart A Part can have many subParts Contains Part pName pNumber subPartsuperPart quantity

CS Cardinality Constraints for Recursive Relationships A Part can be subpart of one superPart A Part can have many subParts

CS Cardinality Constraints for Recursive Relationships A Part can be subpart of one superPart A Part can have many subParts A Part can be subpart of many superParts A Part can have many subParts

CS Cardinality Constraints for Recursive Relationships A Part can be subpart of one superPart A Part can have many subParts A Part can be subpart of many superParts A Part can have many subParts

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

CS 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? Cardinality for relationship types ?

CS An Application Example Courses offered in CS Dept, WPI, in B term Next time …