Session 2 Welcome: The fifth learning sequence

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

Entity-Relationship Model
Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
Text-Book Chapters (7 and 8) 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,
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.
Database Design and the E-R Model Chapter 7 [1 of 2]
Databases Revision.
DATABASE APPLICATION DEVELOPMENT SAK 3408 Database Design II (week 3)
Entity-Relationship Data Model CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Chapter 2: Entity-Relationship Model (Continued)
CS411 Database Systems Kazuhiro Minami
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
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
ER Data Models Ctd. CSET 3300.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
1 Session 2 Welcome: The fifth learning sequence “ Entity-Relationship Model -2“ E-R Model Recap : In the previous learning sequence, we discussed the.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
Entity-Relationship Model
SAnta Clara UniversityHolliday – COEN 1782–1 Today’s Topic Today: u Constraints, Weak Entity Sets, Entity- Relationship Design. u Read Sections
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Database Design and Programming Jan Baumbach Adopted from previous slides of Peter Schneider-Kamp.
Entity-Relationship Data Model
Chapter 2: Entity-Relationship Model
COP Introduction to Database Structures
Introduction to Database Systems, CS420
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Session 2 Welcome: To the fourth learning sequence
Entity-Relationship Model
Entity-Relationship Model
Entity-Relationship Model
Entity Relationship Model
COP4710 Database Systems E-R Model.
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Weak Entity Sets Sometimes an E.S. E ’s key comes not (completely) from its own attributes, but from the keys of one or more E.S.’s to which E is linked.
A Table with a View: Database Queries
Entity-Relationship Model
Constraints in Entity-Relationship Models
CPSC-310 Database Systems
Entity/Relationship Model
Instructor: Zhe He Department of Computer Science
DATABASE MANAGEMENT SYSTEMS
Chapter 2: Entity-Relationship Model
Entity-Relationship Model
Session 2 Welcome: The seventh learning sequence
Chapter 6: Entity-Relationship Model
A Table with a View: Database Queries
Chapter 7: Entity-Relationship Model
CS4433 Database Systems E-R Model.
Entity Relation Model Tingting Zhang.
Database Management system
Database Management system
Entity Relationship Model
Chapter 2: Entity-Relationship Model
ER MODELING Instructor: SAMIA ARSHAD
Entity-Relationship Data Model
CS 405G: Introduction to Database Systems
Presentation transcript:

Session 2 Welcome: The fifth learning sequence “ Entity-Relationship Model -2“ E-R Model Recap : In the previous learning sequence, we discussed the introduction to E-R model. Present learning: We shall explore the following definitions: - Keys in E-R MODEL. - Weak Entity. - Design techniques.

Entity-Relationship Model 2 Keys Weak entity sets

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.

Keys in E/R Diagrams Underline the key attribute(s).

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

Keys A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity. A candidate key of an entity set is a minimal super key Customer-id is candidate key of customer account-number is candidate key of account Although several candidate keys may exist, one of the candidate keys is selected to be the primary key.

Participation of an Entity Set in a Relationship Total participation (indicated by double line): every entity in the entity set participates in at least one relationship in the relationship set E.g. participation of loan in borrower is total every loan must have a customer associated to it via borrower Partial participation: some entities may not participate in any relationship in the relationship set E.g. participation of customer in borrower is partial

Participation of an Entity Set in a Relationship

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.

Example 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 related to the player by Plays-on should be unique.

In E/R Diagrams name number name Plays- on Players Teams Double diamond for supporting many-one relationship. Double rectangle for the weak entity set.

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. 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.

Weak Entity-Set (Cont.) An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the existence of a identifying entity set it must relate to the identifying entity set via a total, one-to-many relationship set from the identifying to the weak entity set Identifying relationship depicted using a double diamond The discriminator (or partial key) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set. The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence dependent, plus the weak entity set’s discriminator.

Weak Entity Sets (Cont.) Note: the primary key of the strong entity set is not explicitly stored with the weak entity set, since it is implicit in the identifying relationship. If loan-number were explicitly stored, payment could be made a strong entity, but then the relationship between payment and loan would be duplicated by an implicit relationship defined by the attribute loan-number common to payment and loan

Weak Entity Sets (Cont.) We depict a weak entity set by double rectangles. We underline the discriminator of a weak entity set with a dashed line. payment-number – discriminator of the payment entity set Primary key for payment – (loan-number, payment-number)

Design Techniques Avoid redundancy. Don’t use an entity set when an attribute will do.

Avoiding Redundancy Redundancy occurs when we say the same thing in two different ways. Redundancy wastes space and (more importantly) encourages inconsistency. The two instances of the same fact may become inconsistent if we change one and forget to change the other, related version.

Example: Good name name addr Advises Students Teacher This design gives the address of each teacher exactly once.

Example: Bad name name addr Advises Student Teachers Adviser This design states the adviser of a student twice: as an attribute and as a related entity.

Example: Bad name Adviser Adviser-Address Students This design repeats the adviser’s address once for each student; loses the address if there are temporarily no students for an adviser.

Entity Sets Versus Attributes An entity set should satisfy at least one of the following conditions: It is more than the name of something; it has at least one non key attribute. or It is the “many” in a many-one or many-many relationship.

Example: Good name name address Advises Students Teacher Teachers deserves to be an entity set because of the nonkey attribute address. Students deserves to be an entity set because it is the “many” of the many-one relationship Advises.

Example: Good name Adviser Students There is no need to make the adviser an entity set, because we record nothing about advisers besides their name.

Example: Bad name name Advises Students Teachers Since the teacher is nothing but a name, and is not at the “many” end of any relationship, it should not be an entity set.

E-R Diagram Summary: In this learning sequence, we discussed the keys and weak entity sets in Entity- Relationship diagram.

END