Home Work. Design Principles and Weak Entity Sets.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

High-Level Database Models Spring 2011 Instructor: Hassan Khosravi.
Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
Database Management System Module 3:. Complex Constraints In this we specify complex integrity constraints included in SQL. It relates to integrity constraints.
Design Principles: Faithfulness
Design Principles: Faithfulness
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Entity-Relationship Data Model CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan.
A four-way Relationship
Lecture 2: Entity/Relationship modelling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
The Entity-Relationship Data Model
1 Lecture 3: Database Modeling (continued) April 5, 2002.
Concepts of Database Management Seventh Edition
1 The Entity-Relationship Data Model Chapter 2 (Database Design)
Multiplicity in E/R Diagrams
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
CS411 Database Systems Kazuhiro Minami
Data Modeling Using the Entity-Relationship Model
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity-Relationship modeling Transparencies
Data Modeling Using the Entity-Relationship Model
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Database Systems The Entity-Relationship Model
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 2/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Entity-Relationship Data Model N. Harika Lecturer(csc)
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 3 Introduction to a First Course in Database Systems.
Databases : Entity-Relationship Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
The Relational Database Model
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
The Relational Model 01/28/2014 – Material from Chapter 4 (Chap2 and Chap3 make an appearance)
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Entity-Relationship Model
SAnta Clara UniversityHolliday – COEN 1782–1 Today’s Topic Today: u Constraints, Weak Entity Sets, Entity- Relationship Design. u Read Sections
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
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.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
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.
1 Database Systems Entity Relationship (E-R) Modeling.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
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.
Modeling: Entity-Relationship Diagrams
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Entity-Relationship Data Model
COP Introduction to Database Structures
Logical Database Design and the Rational Model
Constraints in Entity-Relationship Models
Lecture 2 The Relational Model
name category name price makes Company Product stockprice buys employs
Entity-Relationship Data Model
Database Dr. Roueida Mohammed.
Chapter 3: Multivalued Dependencies
Session 5: Weak Entity Sets and ER Model to Relational ( )
Presentation transcript:

Home Work

Design Principles and Weak Entity Sets

Design Principles We have yet to learn many of the details of the E/R model, but we have enough to begin the crucial issue of what constitutes a good design and what should be avoided. In this section, we offer some useful design principles.

Faithfulness The design should be faithful to the specifications of the application. – That is, the entity sets and their attributes should reflect reality. You can’t attach an attribute number-of- cylinders to Stars although that attribute could make sense for an entity set Automobiles.

Avoiding Redundancy Everything one only -Two representations of the same thing take more space, when the data is stored, than either representation alone -Whatever can go wrong will go wrong. forget to update all available copies will cause problems.

Simplicity Counts Avoid introducing more elements into your design than is absolutely NOT necessary.

Choosing the Right Relationships Entity sets can be connected in various ways by relationships. However, adding to our design every possible relationship is not often a good idea because:- - it can lead to redundancy -the resulting database could require much more space to store redundant elements and modifying the database could become too complex.

The Modeling of Constraints So far we saw how to model a slice of the real world using entity sets and relationships. However, there are some other important aspects of the real world that we can NOT model with the tools seen so far. Information such as these often takes the form of CONSTRAINTS on data.

Classification of Constraints Rough classification of commonly used constraints 1.Keys are attributes or sets of attributes that uniquely identify an entity within its entity set. Gives you unique access to a record in a table

Keys Three useful points to remember about keys -A key can consist of more than one attribute, -There can also be more than one possible key for an entity set. - Uniqueness, Meaningfulness, Ease of use and Size.

Classification of Constraints 1. Single-Value Constraints are requirements that the value in a certain context be unique. Keys are a major source of single-value constrains, since they require that each entity in an entity set has unique value(s) for the key attribute(s). However there are other sources of single-value constraints, such as many-one relationships.

Single-Value Constraints An important property of a database design is that there is at most one value playing a particular role.- (one value exists in that role) Several ways in which single-value constraints are expressed in the E/R model.

Single-Value Constraints 1.Each attribute of an entity set has a single value. Sometimes it is permissible for an attribute’s value to be missing for some entities, in which case we have to invent a NULL VALUE to serve as the value of that attribute. 2.A relationship R that is many-one from entity set E to entity set F implies a single-value constraint. That is for each entity e in E, there is at most one associated entity f in F.

Classification of Constraints 3. Referential Integrity constraints are requirements that a value referred to by some object actually exists in the database. Referential integrity is analogous to a prohibition against dangling pointers, or other kinds of dangling references, in conventional programs.

Referential Integrity constraints A referential integrity constraint asserts that exactly one value exists in that role. We could see a constraint that an attribute have a non-null, single value as a kind of referential integrity requirement. (referential integrity is more commonly used to refer to relationships among entity sets ) Integrity constraint to ensure that associations between records are valid.

Referential Integrity in E/R Diagrams We can extend the arrow notation in E/R diagrams to indicate whether a relationship is expected to support referential integrity in one or more directions. Round arrows from Owns to Studios expressed a RI that every movie must be owned by one studio. Similarly, every president runs a studio that exists in the Studio entity set.

Other Kinds of Constraints As mentioned earlier, there are other kinds of constraints one could wish to enforce in a database. 4. Domain Constraints require that the value of an attribute must be drawn from a specific set of values or lie within a specific range.

Domain Constraints Domain Constraints restrict the value of an attribute to be in a limited set. A stronger domain constraint would be to declare an enumerated type for an attribute or range of values. Set of all possible values over which a data item can range. Ie. Domain for days of the month E/R below represent a constraint on the number of stars per movie.

Other Kind of Constraints 5. General Constraints are arbitrary assertion that are required to hold in the database. ie. Random declaration

Classification of Constraints There are several ways these constraints are important. - they tell us something about the structure of those aspects of the real world that we are modeling.

Weak Entity Sets An occasional condition in which an entity set’s key is composed of attributes some or all of which belong to another entity set. Such an entity set is called a WEAK ENTITY SET.

Causes of Weak Entity Sets Two principle sources of weak entity sets 1.Sometimes entity sets fall into a hierarchy based on classifications unrelated to the isa hierarchy 2.The second common source is the connecting entity sets that introduced as a way to eliminate a multiway relationship. These entity sets often have no attributes of their own

Requirement for Weak Entity Sets We can not obtain key attributes for a weak entity set indiscriminately. Rather if E i1s a weak entity set, then its key consists of: 1.Zero or more of its own attributes 2.Key attributes from entity sets that are reached by certain many-one relationships from E to other entity sets. These many-one relationships are called supporting relationships for E

Weak Entity Set Notation The following conversions to indicate that an entity set is weak and to declare its key attributes 1.If an entity set is weak, it will be shown as a rectangle with a double border 2.Its supporting many-one relationships will be shown as diamonds with double border.

Summary Design Principles Choosing the Right Relationships The Modeling of Constraints Classification of Constraints Weak Entity Sets Causes of Weak Entity Sets Requirement for Weak Entity Sets Weak Entity Set Notation