Copyright © 2003 Addison-Wesley Jesper Rosholm Tørresø.

Slides:



Advertisements
Similar presentations
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advertisements

Data Modeling and the Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Data Modeling and the Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
ER Modeling An E-R model is a conceptual (or logical) data model that includes –Entity (classes) –Attributes of each entity –Relationship types between.
Review Questions What is data modeling? What is the actual data model that is created called? Data modeling is a technique for organizing and documenting.
Modeling Data The Entity Relationship Model (ER) For Database Design.
Copyright © 2003 Addison-Wesley Defining Relational Databases What is an Access database? How do you create an Access database? How do you create and modify.
Databases and Processing Modes. Fundamental Data Storage Concepts and Definitions What is an entity? An entity is something about which information is.
Representing Information with Data Models What is a data model and data modeling? What are Entities and Attributes? Relationships between entities Modeling.
Copyright © 2003 Addison-Wesley Your name here. Copyright © 2003 Addison-Wesley Data Modeling with ER Diagrams What is an Entity-Relationship Model? How.
Chapter Five Data Modeling with the Entity-Relationship Model.
Representing Information. Data Models A data model is a precise description of information content Types of data models Conceptual (high-level): in terms.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Implementing an REA Model in a Relational Database
Example BigHit Video Inc. wants to create an information system for online sales of movies in both DVD and videotape format. People will be allowed to.
Chapter 2: Entity-Relationship Model (Continued)
Copyright © 2003 Addison-Wesley Your name here. Copyright © 2003 Addison-Wesley Representing Information with Data Models What is a data model? How does.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
APPENDIX C DESIGNING DATABASES
Database Design Using the REA Data Model
Entity-Relationship modeling Transparencies
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data Modeling with ER Diagrams What is an Entity-Relationship Model? How is an E-R model represented as an E-R diagram? How can a video store be modeled.
Database Design Using the REA Data Model
Your Name Here See Page Notes for Info about Hyperlinks.
Chapter 5 Entity–Relationship Modeling
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Concepts and Terminology Introduction to Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
Implementing an REA Model in a Relational Database
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Data Modeling IST210 Class Lecture.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
By: Richard Fleischman & Sharon Young Advanced Data Models.
Chapter 9 Applying UML and Patterns -Craig Larman
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Copyright © 2003 Addison-Wesley Sree Nilakanta. Copyright © 2003 Addison-Wesley Developing Relational Models What is the relational model and what is.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Description and exemplification of entity-relationship modelling.
1 Database Course. 2 General Information TAs: –Sara Cohen –Jonathan Mamou Course Moderated Newsgroup: local.course.db.ta Students.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
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.
Tutorial on E-R Diagrams 1.Learn basic terminology and symbols –See next four slides; refer to as needed in steps 2-4 below 2.Learn the basics of E-R diagramming.
Methodology - Logical Database Design. 2 Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Entity Relationship Diagram ERD. Background Peter Chen developed ERDs in Charles Bachman and James Martin have added some slight refinements to.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Chapter 12 Information Systems.
ER MODEL Lecture 3.
Entity relationship diagrams
Databases and Structured Files: What is a database?
Presentation transcript:

Copyright © 2003 Addison-Wesley Jesper Rosholm Tørresø

Copyright © 2003 Addison-Wesley Data Modeling with ER Diagrams What is an Entity-Relationship Model? How is an E-R model represented as an E-R diagram? How can BigHit Video be modeled as an E-R diagram? What is a role in a relationship type? How can we record the history of video rentals? How are cardinalities and related to roles? How can we represent purchase orders? How can we represent time cards and pay statements? What is an object-oriented data model?

Copyright © 2003 Addison-Wesley Entity-Relationship Modeling * An E-R model is a data model that includes –Entity classes –Attributes of each class –Relationship types between classes –Constraints Types of attributes Designation of key attributes Cardinalities of relationship types An E-R Model is typically represented graphically –E-R diagram, the technique we use (“We” is the book) –UML diagram, an emerging standard for specifying E-R models and software design (!! The one we/I4DAB1 also will use/jrt !!)

Copyright © 2003 Addison-Wesley Entity Relationship Diagrams * Sample diagram for entity class Customer

Copyright © 2003 Addison-Wesley UML and ER diagrams * Simple class diagram (no method or properties shown) Class diagram with relationship.

Copyright © 2003 Addison-Wesley E-R Diagram for Class Video * Sample diagram for entity class Video

Copyright © 2003 Addison-Wesley For a short, a comment.. * Every object in a object system (i.e. the object oriented code performing an application) has a unique reference to it, otherwise it is lost, that means object data, attributes, are lost an can not be accessed. In a database, it is something similar, every piece of data (i.e. tuples/records/rows or posts) may* have a unique identifier, a key, to ensure access to data. *”may have” not necessarily “must have” In both case when we are modeling the system we do think about the reference/key constraint. But not at the beginning of process (Iterative development)

Copyright © 2003 Addison-Wesley Relationship Types * Example of representing relationship type Owns between classes Store and Video

Copyright © 2003 Addison-Wesley Constraints on Relationship Types * Example of cardinality and participation constraints

Copyright © 2003 Addison-Wesley Modeling Video Rentals * Examples of current rentals and previous rentals Differences are in cardinalities and attribute names How do we ensure no data/information are missed/lost ? Putting it into an object/entity

Copyright © 2003 Addison-Wesley Modeling Video Rentals as an Entity Class * Diagram shows entity class Rental and its relationship types with Customer and Video Note cardinalities and participation constraints –A Rental entity cannot exist without being related to both a customer and a video Problem occurs because Rental has no key attribute “BOX IN”

Copyright © 2003 Addison-Wesley Weak Entity Classes * A weak entity class is –An entity class with no key of its own –An entity class whose entities cannot exist without being related to other entities An identifying relationship type is –A relationship type that determines the keys of the weak entities

Copyright © 2003 Addison-Wesley Roles in Relationship Types * Each entity in a relationship plays a specific role in it Roles are particularly important in relationship types that relate an entity class to itself –Each person in an IsChildOf relationship is either a parent or a child

Copyright © 2003 Addison-Wesley Employee Roles and Cardinalities * Is this an accurate model of the relationships between employees and stores? For example, does this diagram answer these questions correctly? –Does a store have to have a manager? –Can an employee be the manager of more than one store? –What other questions can you ask about roles and cardinalities?

Copyright © 2003 Addison-Wesley Purchase Orders * What does the diagram below mean? –How do we buy many copies of a single movie? –Does each video have its own videoId before it is received? –What does it mean for an order of a video to have a quantity? The problem with the diagram is with class Video The diagram fails to distinguish between a movie and a copy of a movie (a video) We need to revise the diagram to show Movie as an entity class

Copyright © 2003 Addison-Wesley Modeling Videos and Movies * This diagram more accurately specifies the true nature of Video and Movie –It also has an accurate specification of PurchaseOrder

Copyright © 2003 Addison-Wesley Time Cards and Pay Statements * Classes TimeCard and PayStatement are weak Does this diagram show the correct identifying relationships and discriminators? –For example, can an employee have 2 time cards that begin at the same time but are at different stores?

Copyright © 2003 Addison-Wesley Adding DVD and Videotape * How can we add DVD and videotape to our model? –Do DVD and videotape have different attributes? These diagrams show 2 different models –An entity of class Video can be either a DVD or a videotape (upper diagram) –DVD and Videotape are different entity classes (lower diagram)

Copyright © 2003 Addison-Wesley Adding Relationship Types * Problems occur when we add relationship types of the data model with separate classes for DVD and Videotape –Relationship types must be duplicated –We cannot enforce constraints

Copyright © 2003 Addison-Wesley Modeling with Inheritance * Class Video is a common superclass of both DVD and Videotape –Attributes of Video (videoId and dateAcquired) are shared –Relationship types with Rental and Movie are shared –An entity of class Video must be either a DVD or a videotape

Copyright © 2003 Addison-Wesley Case in Point E-R Model for Video Sales for BigHit Online Process –Evaluate statement of goals for information system –Evaluate entity classes, attributes and relationship types from Chapter 3 –Draw preliminary E-R diagram with entity classes and their attributes –Add relationship types to E-R diagram –Define cardinality and participation constraints –Add any appropriate inheritance –Evaluate diagram for clarity, accuracy and completeness

Copyright © 2003 Addison-Wesley Evaluate Statement of Goals BigHit Video Inc. wants to create an information system for online sales of movies in both DVD and videotape format. People will be allowed to register as customers of the online site and to update their stored information. Information must be maintained about customers’ shipping addresses, addresses and credit cards. In a single sale, customers will be allowed to purchase any quantity of videos. The items in a single sale will be shipped to a single address and will have a single credit card charge. A customer will be provided with a virtual shopping cart to store items to be purchased. As each item is selected, it is added to the shopping cart. When the customer finishes shopping, he will be directed to a checkout area where payment and shipping information is entered. Once the sale is complete, the customer will be sent a receipt by .

Copyright © 2003 Addison-Wesley Evaluate Entity Classes and Attributes

Copyright © 2003 Addison-Wesley Evaluate Relationship Types Relationship TypeEntity Class Cardinality RatioAttibutes PurchasesCustomerSale one-to-many IncludesSaleMovie many-to-many quantity SelectsCustomerShoppingCart one-to-many IncludesShoppingCartMovie many-to-many quantity

Copyright © 2003 Addison-Wesley Resulting E-R Diagram for BigHit Online