Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI

Slides:



Advertisements
Similar presentations
Database Management Systems Chapter 3 The Relational Data Model (I) Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
Advertisements

1–1 Students Entity/Relationship Model Diagrams to represent designs. Entity like object, = “thing.” Entity set like class = set of “similar” entities/objects.
CSCI 305 – Fall 2013 The Entity-Relationship Model Based on Slides by Prof. Brian King.
The E-R Model CS 157A Lecture 4 Prof. Sin-Min Lee
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
Databases : Relational Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman distributes.
Entity-Relationship Model
Chapter 4 Notes. Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations.
Entity-Relationship Model. The process of designing a database begins with: –an analysis of what information the database must hold, and –the relationships.
Database Design and the E-R Model Chapter 7 [1 of 2]
1 Relational Model and Translating ER into Relational.
1 Entity-Relationship Model Slides by Jeffrey Ullman Modified by J. Welch to replace beers with candies.
Winter 2002Arthur Keller – CS 18015–1 Schedule Today: Feb. 28 (TH) u Datalog and SQL Recursion, ODL. u Read Sections , Project Part 6.
Entity-Relationship Model Lecture 2. Database Modeling and Implementation Process Ideas ER DesignRelational Schema Relational DBMS Implementation.
1 Announcement Recitation time  Before midterm: 6-7pm, by Earl Wagner  After midterm: 5-6pm, by Yi Qiao Newsgroup safe to subscribe  Will not cause.
Entity-Relationship Model
Fall 2001Arthur Keller – CS 1801–1 Computer Science 180: Database Systems Arthur M. Keller (best way to reach me) Office: Baskin.
Entity-Relationship Data Model Alex Ostrovsky. Presentation Overview ► Short historical overview ► Elements of E-R Model ► Basic organization & relationships.
Fall 2001Arthur Keller – CS 1802–1 Schedule Today Sep. 25 (T) u More Entity-Relationship Model. u Read Sections Note: Sep. 27 (TH) Class cancelled.
1 The Relational Data Model Tables Schemas Conversion from E/R to Relations.
The Entity-Relationship Data Model
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
1 The Entity-Relationship Data Model Chapter 2 (Database Design)
CS411 Database Systems Kazuhiro Minami
What is a Database Management System? 1. Manages very large amounts of data. 2. Supports efficient access to very large amounts of data. 3. Supports concurrent.
Entity Relationship Modelling. What is Entity Relationship Modelling? The Entity-Relationship model is – ” “ a data model for high-level descriptions.
Entity-Relationship Data Model N. Harika Lecturer(csc)
Data Warehouse Fundamentals Rabie A. Ramadan, PhD 5.
CSET 3300 Databases & ER Data Models. Databases A database is a collection of data (information). A DataBase Management System (DBMS) is a software system.
Constraints on Relations Foreign Keys Local and Global Constraints Triggers Following lecture slides are modified from Jeff Ullman’s slides
1 Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations.
Databases : Entity-Relationship Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Database Management Systems Chapter 2 The Entity-Relationship Data Model Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
1 Entity-Relationship Model Chapter 2 Copyright : Jeff Ullman + Hank Korth.
Tallahassee, Florida, 2015 COP4710 Database Systems E-R Model Fall 2015.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Entity-Relationship Model
Data Modeling Translating E-R Diagrams to Relations
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems.
Dale Roberts 11/26/ Department of Computer and Information Science, School of Science, IUPUI Fall 2003 Dale Roberts, Lecturer Computer Science, IUPUI.
Databases 1 Fifth lecture. Entity-Relationship Model Diagrams Class hierarchies Weak entity sets From E/R diagrams to Relations 2.
CSCE 520- Relational Data Model Lecture 2. Oracle login Login from the linux lab or ssh to one of the linux servers using your cse username and password.
Entity-Relationship Modelling ER Diagrams and EER Diagrams Some design techniques Elements and process: text  diagram Slides by Jeff Ullman (infolab.stanford.edu/~ullman/dscb/pslides/er.ppt),
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 4 Introduction to a First Course in Database Systems.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Entity-Relationship Model E/R Diagrams Converting E/R Diagrams to Relations.
1 Unified Modeling Language. 2 UML  UML is designed to model software, but has been adapted as a database modeling language. – No multiway relationships.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
A short revision on entity- relationship modelling.
A short review on entity- relationship modelling.
Computational Biology Dr. Jens Allmer Lecture Slides Week 5.
1 Database Design: DBS CB, 2 nd Edition Logical Database Model: Entity Relationship Model & Object Description Language & Unified Modeling Language Ch.
1 The Relational Data Model Tables Schemas Conversion from E/R to Relations.
Database Design and Programming Jan Baumbach Adopted from previous slides of Peter Schneider-Kamp.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture.
Session 2 Welcome: To the fourth learning sequence
Entity-Relationship Model
Entity-Relationship Diagrams
Example: R3 := R1 × R2 R3( A, R1.B, R2.B, C )‏ R1( A, B )‏ R2( B, C )‏ R3( A, R1.B, R2.B, C )‏
CPSC-310 Database Systems
The Entity-Relationship Model
Instructor: Zhe He Department of Computer Science
Database Models Relational Model
CPSC-310 Database Systems
CPSC-310 Database Systems
The Relational Data Model
Instructor: Zhe He Department of Computer Science
Presentation transcript:

Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI Data Modeling Entity-Relationship Diagrams

Dale Roberts 2 Framework for E-R Design is a serious business. The “boss” knows they want a database, but they don’t know what they want in it. Sketching the key components is an efficient way to develop a working database.

Dale Roberts 3 Purpose of E-R Model The E-R model allows us to sketch database schema designs. Includes some constraints, but not operations. Designs are pictures called entity- relationship diagrams. Later: convert E-R designs to relational DB designs.

Dale Roberts 4 Entity Sets Entity = “thing” or object. Entity set = collection of similar entities. Similar to a class in object-oriented languages. Attribute = property of (the entities of) an entity set. Attributes are simple values, e.g. integers or character strings, not structs, sets, etc.

Dale Roberts 5 E-R Diagrams In an entity-relationship diagram: Entity set = rectangle. Attribute = oval, with a line to the rectangle representing its entity set. Warning! Graphical representations are inconsistent. Attributes using ovals shall be changed to more of a “Class Diagram” style later, to save space. The later style insists on singular nouns and uses lines for relationships.

Dale Roberts 6 Example: Entity Entity set Beers has two attributes, name and manf (manufacturer). Each Beers entity has values for these two attributes, e.g. (Bud, Anheuser-Busch) Underlined attribute(s) is(are) primary key(s) Beers name manf

Dale Roberts 7 Relationships This relationship has an attribute associated with it. A relationship connects two or more entity sets. It is represented by a diamond, with lines to each of the entity sets involved.

Dale Roberts 8 Example: Relationships Drinkers addrname Beers manfname Bars name license addr Note: license = beer, full, none Sells Bars sell some beers. Likes Drinkers like some beers. Frequents Drinkers frequent some bars.

Dale Roberts 9 Relationship Set The current “value” of an entity set is the set of entities that belong to it. Example: the set of all bars in our database. The “value” of a relationship is a relationship set, a set of tuples with one component for each related entity set.

Dale Roberts 10 Example: Relationship Set For the relationship Sells, we might have a relationship set like: BarBeer Joe’s BarBud Joe’s BarMiller Sue’s Bar Bud Sue’s BarPete’s Ale Sue’s BarBud Lite

Dale Roberts 11 Multiway Relationships Sometimes, we need a relationship that connects more than two entity sets. Suppose that drinkers will only drink certain beers at certain bars. Our three binary relationships Likes, Sells, and Frequents do not allow us to make this distinction. But a 3-way relationship would.

Dale Roberts Example: 3-Way Relationship 5/9/

Dale Roberts 13 Bars Beers Drinkers name addr manf nameaddr license Preferences Example: 3-Way Relationship

Dale Roberts 14 A Typical Relationship Set BarDrinkerBeer Joe’s BarAnnMiller Sue’s BarAnnBud Sue’s BarAnnPete’s Ale Joe’s BarBobBud Joe’s BarBobMiller Joe’s BarCalMiller Sue’s BarCalBud Lite

Dale Roberts 15 Many-Many Relationships Focus: binary relationships, such as Sells between Bars and Beers. In a many-many relationship, an entity of either set can be connected to many entities of the other set. E.g., a bar sells many beers; a beer is sold by many bars.

Dale Roberts 16 In Pictures: many-many

Dale Roberts 17 Many-One Relationships Some binary relationships are many-one from one entity set to another. Each entity of the first set is connected to at most one entity of the second set. But an entity of the second set can be connected to zero, one, or many entities of the first set.

Dale Roberts 18 In Pictures: many-one

Dale Roberts 19 Example: Many-One Relationship Favorite, from Drinkers to Beers is many-one. A drinker has at most one favorite beer. But a beer can be the favorite of any number of drinkers, including zero.

Dale Roberts 20 Example: Many-One Relationship DrinkersBeers Likes Favorite Notice: two relationships connect the same entity sets, but are different.

Dale Roberts 21 One-One Relationships In a one-one relationship, each entity of either entity set is related to at most one entity of the other set. Example: Relationship Best-seller between entity sets Manfs (manufacturer) and Beers. A beer cannot be made by more than one manufacturer, and no manufacturer can have more than one best- seller (assume no ties).

Dale Roberts 22 In Pictures: one-one

Dale Roberts 23 Representing “Multiplicity” Show a many-one relationship by an arrow entering the “one” side. Remember: Like a functional dependency. Show a one-one relationship by arrows entering both entity sets. Rounded arrow = “exactly one,” i.e., each entity of the first set is related to exactly one entity of the target set. Pointed arrow = “zero or one,” i.e., each entity of the first set is related to zero or one entity of the target set. (Optionality)

Dale Roberts 24 Example: One-One Relationship Consider Best-seller between Manfs and Beers. Some beers are not the best-seller of any manufacturer, so a rounded arrow to Manfs would be inappropriate. But a beer manufacturer has to have a best- seller.

Dale Roberts 25 In the E-R Diagram ManfsBeers Best- seller A manufacturer has exactly one best seller. A beer is the best- seller for 0 or 1 manufacturer.

Dale Roberts Modeling Shift 26

Dale Roberts 5/9/ Acknowledgements McFadden and Hoffer. Database Management Loney, Kevin. Oracle Database 10g The Complete Reference Ullman, Jeff. Database Systems The Complete Book. DatabaseAnswers.com