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

Slides:



Advertisements
Similar presentations
Logical DB Design: ER to Relational Entity sets to tables. Employees ssn name lot CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER, PRIMARY.
Advertisements

Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
1–1 Students Entity/Relationship Model Diagrams to represent designs. Entity like object, = “thing.” Entity set like class = set of “similar” entities/objects.
Overview of Database Systems CPSC 315 – Programming Studio Spring 2009 Team Project 1, Lecture 1.
CSCI 305 – Fall 2013 The Entity-Relationship Model Based on Slides by Prof. Brian King.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
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.
Design Principles: Faithfulness
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Example. Crews might have a number and some description,
Entity-Relationship Model. The process of designing a database begins with: –an analysis of what information the database must hold, and –the relationships.
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Entity set E is weak if in order to identify entities.
Design Principles: Faithfulness
1 Entity-Relationship Model Slides by Jeffrey Ullman Modified by J. Welch to replace beers with candies.
Entity-Relationship Model Lecture 2. Database Modeling and Implementation Process Ideas ER DesignRelational Schema Relational DBMS Implementation.
System Concepts and Architecture Rose-Hulman Institute of Technology Curt Clifton.
Entity-Relationship Model
A four-way Relationship
Lecture 2: Entity/Relationship modelling
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.
The Entity-Relationship Data Model
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
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.
Midterm Review Zaki Malik October 09, Basic Operators Covered.
CSET 3300 Databases & ER Data Models. Databases A database is a collection of data (information). A DataBase Management System (DBMS) is a software system.
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
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.
ER Data Models Ctd. CSET 3300.
1 Entity-Relationship Model Chapter 2 Copyright : Jeff Ullman + Hank Korth.
CS 564 Database Management Systems: Design and Implementation
1 Session 2 Welcome: The fifth learning sequence “ Entity-Relationship Model -2“ E-R Model Recap : In the previous learning sequence, we discussed the.
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
Dale Roberts 11/26/ Department of Computer and Information Science, School of Science, IUPUI Fall 2003 Dale Roberts, Lecturer Computer Science, IUPUI.
Home Work. Design Principles and Weak Entity Sets.
Databases 1 Fifth lecture. Entity-Relationship Model Diagrams Class hierarchies Weak entity sets From E/R diagrams to Relations 2.
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),
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Entity-Relationship Model E/R Diagrams Converting E/R Diagrams to Relations.
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
April 20022/CS/3X EER 1 Database Design Enhanced entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading.
1 Unified Modeling Language. 2 UML  UML is designed to model software, but has been adapted as a database modeling language. – No multiway relationships.
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
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.
Modeling: Entity-Relationship Diagrams
A short review on entity- relationship modelling.
1 Database Design: DBS CB, 2 nd Edition Logical Database Model: Entity Relationship Model & Object Description Language & Unified Modeling Language Ch.
CS422 Principles of Database Systems From ER to Relations Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture notes.
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
Constraints in Entity-Relationship Models
CPSC-310 Database Systems
The Entity-Relationship Model
Instructor: Zhe He Department of Computer Science
CPSC-310 Database Systems
Session 2 Welcome: The fifth learning sequence
Session 5: Weak Entity Sets and ER Model to Relational ( )
Presentation transcript:

Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI Data Modeling Attributes, Roles, Subclasses, Keys and Weak Entities

Dale Roberts 2 Attributes on Relationships Sometimes it is useful to attach an attribute to a relationship. Think of this attribute as a property of tuples in the relationship set. BarsBeers Sells price Price is a function of both the bar and the beer, not of one alone.

Dale Roberts 3 Equivalent Diagrams Without Attributes on Relationships Create an entity set representing values of the attribute. Make that entity set participate in the relationship. BarsBeers Sells price Prices Note convention: arrow from multiway relationship = “all other entity sets together determine a unique one of these.”

Dale Roberts 4 Roles Sometimes an entity set appears more than once in a relationship. Label the edges between the relationship and the entity set with names called roles. Relationships that have the same entity sets on both ends are commonly referred to as recursive relationships or self-referential relationships.

Dale Roberts Example: Roles Drinkers Married husbandwife Relationship Set HusbandWife BobAnn JoeSue…

Dale Roberts 6 Example: Roles

Dale Roberts 7 Subclasses Subclass = special case = fewer entities = more properties. Example: Ales are a kind of beer. Not every beer is an ale, but some are. Let us suppose that in addition to all the properties (attributes and relationships) of beers, ales also have the attribute color.

Dale Roberts 8 Subclasses in E-R Diagrams Assume subclasses form a tree. I.e., no multiple inheritance. Isa triangles indicate the subclass relationship. Point to the superclass. Beers Ales isa namemanf color

Dale Roberts 9 E-R Vs. Object-Oriented Subclasses In OO, objects are in one class only. Subclasses inherit from superclasses. In contrast, E-R entities have representatives in all subclasses to which they belong. Rule: if entity e is represented in a subclass, then e is represented in the superclass (and recursively up the tree).

Dale Roberts 10 Example: Representatives of Entities Beers Ales isa namemanf color Pete’s Ale

Dale Roberts 11 Keys A key is a set of attributes for one entity set such that no two entities in this set agree on all the attributes of the key. It is allowed for two entities to agree on some, but not all, of the key attributes. We must designate a key for every entity set.

Dale Roberts 12 Keys in E-R Diagrams Underline the key attribute(s). In an Isa hierarchy, only the root entity set has a key, and it must serve as the key for all entities in the hierarchy. Beers Ales isa namemanf color

Dale Roberts 13 Example: a Multi-attribute Key Courses dept number hoursroom Note that hours and room could also serve as a key, but we must select only one key.

Dale Roberts 14 Weak Entity Sets Occasionally, entities of an entity set need “help” to identify them uniquely. Entity set E is said to be weak if in order to identify entities of E uniquely, we need to follow one or more many-one relationships from E and include the key of the related entities from the connected entity sets.

Dale Roberts 15 Example: Weak Entity Set name is almost a key for football players, but there might be two with the same name. number is certainly not a key, since players on two teams could have the same number. But number, together with the team name related to the player by Plays-on should be unique.

Dale Roberts 16 Weak Entity PlayersTeams Plays- on name number Double diamond for supporting many-one relationship. Double rectangle for the weak entity set. Note: must be rounded because each player needs a team to help with the key.

Dale Roberts Weak Entity 17

Dale Roberts 18 Weak Entity-Set Rules A weak entity set has one or more many-one relationships to other (supporting) entity sets. Not every many-one relationship from a weak entity set need be supporting. But supporting relationships must have a rounded arrow (entity at the “one” end is guaranteed). The key for a weak entity set is its own underlined attributes and the keys for the supporting entity sets. E.g., (player) number and (team) name is a key for Players in the previous example.

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