Data Warehouse Fundamentals Rabie A. Ramadan, PhD 5.

Slides:



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

Text-Book Chapters (7 and 8) Entity-Relationship Model
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
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]
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
2010/1/11 Lecture 1 on Extended Entity Relationship Model This lecture is to describe the methodology of designing an Extended Entity Relationship Model.
Extended E-R Model: Basic Symbols
2008/1/161 Extended Entity Relationship(EER) Model The ER model has been widely used but does not have some shortcomings. It is difficult to represent.
Introduction to Relational Database ISYS 464. Introduction to Relational Model Data is logically structured within relations. Each relation is a table.
Entity-Relationship Model
Information Resources Management February 13, 2001.
Chapter Five Data Modeling with the Entity-Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
Translating ER Model into Relational Model. ER Model  Relational Model Considerations: Minimize the number of relations to reduce query- processing time.
Chapter Five Data Modeling with the Entity-Relationship Model.
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
Chapter 7: Entity-Relationship Model
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
Jennifer Widom UML UML Data Modeling. Jennifer Widom UML Modeling Data Modeling How to represent data for application  Relational model  with design.
Entity-Relationship modeling Transparencies
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
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.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Entities and Attributes
Entity-Relationship Model
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Entity-Relationship Model Ch. 3
Conceptual Data Modeling. What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model.
Databases : Entity-Relationship Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
Dr. Ahmad R. Hadaegh A.R. Hadaegh California State University San Marcos (CSUSM) Page 1 Entity Relational Diagram (ERD) Modeling This particular lecture.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
Systems Analysis and Design Rabie A. Ramadan Slides by Roberta M. Roth University of Northern Iowa.
Chapter 7 Data Modeling with Entity Relationship Diagrams
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
Entity-Relationship Model
Entity Relationship Diagram (2)
DATABASE MANAGEMENT SYSTEM Entity-Relationship Model.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
Entity Relationship Modeling
Modeling A database can be modeled as: a collection of entities, relationship among entities. An entity is an object that exists and is distinguishable.
Databases 1 Fifth lecture. Entity-Relationship Model Diagrams Class hierarchies Weak entity sets From E/R diagrams to Relations 2.
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-2.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
CS3431: C-Term Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
Data Modeling and Entity-Relationship Model I
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.
Database System Concepts, 7 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module 4: Overview of.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture.
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Data Modeling with Entity Relationship Diagrams (Cont.)
Presentation transcript:

Data Warehouse Fundamentals Rabie A. Ramadan, PhD 5

2 Schema Translation

3 Extended Entity Relationship(EER) Model The ER model has been widely used but does not have some shortcomings. It is difficult to represent cases where an entity may have varying attributes dependent upon some property. ER model has been extended into Extended Entity Relationship model It includes more semantics such as generalization, categorization and aggregation.

4 Cardinality: One-to-one relationship A one-to-one relationship between set A and set B is defined as: For all a in A, there exists at most one b in B such that a and b are related, and vice versa. Example A president leads a nation.

5 Cardinality: One-to-one relationship Relational Model: Relation President (President_name, Race, *Nation_name) Relation Nation (Nation_name, Nation_size) Where underlined are primary keys and "*" prefixed are foreign keys Extended Entity Relationship model

6 In Election System : One-to-one relationship !!!!! Person and ID Persons’ and Vote Judge and Box Username and Person

7 Cardinality: Many-to-one relationship A many-to-one relationship from set A to set B is defined as: For all a in A, there exists at most one b in B such that a and b are related, and for all b in B, there exists zero or more a in A such that a and b are related. Example A director directs many movies.

8 Cardinality: Many-to-one relationship Relational Model: Relation Director (Director_name, Age) Relation Movies (Movie_name, Sales_volume, *Director_name) Extended entity relationship model:

9 In Election System : many to one relationship !!!! Box and judge President position and candidates Candidate and votes Candidate and position

10 Cardinality: Many-to-many relationship A many-to-many relationship between set A and set B is defined as: For all a in A, there exists zero or more b in B such that a and b are related, and vice versa. Example Many students take many courses such that a student can take many courses and a course can be taken by many students. many-many

11 Cardinality: Many-to-many relationship Relational Model: Relation Student (Student_id, Student_name) Relation Course (Course_id, Course_name) Relation take (*Student_id, *Course_id) Extended entity relationship model:

12 In Election System : many to many relationship !!!! Boxes and judges at the same place Security table contains many user names and passwords for many persons

13 Data Semantic: Is-a (Subtype) relationship The relationship A isa B is defined as: A is a special kind of B. Example Father is Male.

14 Data Semantic: Is-a (Subtype) relationship Relational Model: Relation Male (Name, Height) Relation Father (*Name, Birth_date) Extended entity relationship model

15 Data Semantic: Disjoint Generalization The process of generalization is to classify similar entities into a single entity. More than one isa relationship can form data abstraction (i.e. superclass and subclasses) among entities. A subclass entity is a subset of its superclass entity. There are two kinds of generalization. The first is disjoint generalization such that subclass entities are mutually exclusive. The second is overlap generalization such that subclass entities can overlap each other. Example of Disjoint Generalization A refugee and a non-refugee can both be a boat person, but a refugee cannot be a non-refugee, and vice versa.

16 Data Semantic: Disjoint Generalization Relational Model: Relation Boat_person (Name, Birth_date, Birth_place) Relation Refugee (*Name, Open_center) Relation Non-refugee (*Name, Detention_center) Extended entity relationship model:

17 Data Semantic: Overlap Generalization Example of Overlap Generalization A computer programmer and a system analyst can both be a computer professional, and a computer programmer can also be a system analyst, and vice versa.

18 Data Semantic: Overlap Generalization Relational Model: Relation Computer_professional (Employee_id, Salary) Relation Computer_programmer (*Employee_id, Language_skill) Relation System_analyst (*Employee_id, Application_system) Extended entity relationship model:

19 Data Semantic: Categorization Relationship In cases the need arises for modeling a single superclass/subclass relationship with more than one superclass(es), where the superclasses represent different entity types. In this case, we call the subclass a category.

20 Data Semantic: Categorization Relationship Relational Model: Relation Department (Borrower_card, Department_id) Relation Doctor (Borrower_card, Doctor_name) Relation Hospital (Borrower_card, Hospital_name) Relation Borrower (*Borrower_card, Return_date, File_id) Extended Entity Relationship Model

21 Data Semantic: Aggregation Relationship Aggregation is a method to form a composite object from its components. It aggregates attribute values of an entity to form a whole entity. Example The process of a student taking a course can form a composite entity (aggregation) that may be graded by an instructor if the student completes the course.

22 Data Semantic: Aggregation Relationship Relational Model: Relation Student (Student_no, Student_name) Relation Course (Course_no, Course_name) Relation Takes (*Student_no, *Course_no, *Instructor_name) Relation Instructor (Instructor_name, Department) Extended Entity Relationship Model

23 Data Semantic: Total Participation An entity is in total participation with another entity provided that all data occurrences of the entity must participate in a relationship with the other entity. Example An employee must be hired by a department.

24 Data Semantic: Total Participation Relational Model: Relation Department (Department_id, Department_name) Relation Employee (Employee_id, Employee_name, *Department_id) Extended entity relationship model:

25 Data Semantic: Partial Participation An entity is in partial participation with another entity provided that the data occurrences of the entity are not totally participate in a relationship with the other entity. Example An employee may be hired by a department.

26 Data Semantic: Partial Participation Relational Model: Relation Department (Department_id, Department_name) Relation Employee (Employee_no, Employee_name, &Department_id) Where & means that null value is allowed Extended entity relationship model:

27 Data Semantic: Weak Entity The existence of a weak entity depends on its strong entity. Example A hotel room must concatenate hotel name for identification.

28 Data Semantic: Weak Entity Relational Model: Relation Hotel (Hotel_name, Ranking) Relation Room (*Hotel_name, Room_no, Room_size) Extended entity relationship model

29 Cardinality: N-ary Relationship Multiple entities relate to each other in an n-ary relationship. Example Employees use a wide range of different skills on each project they are associated with.

30 Cardinality: N-ary Relationship Relational Model: Relation Engineer (Employee_id, Employee_name) Relation Skill (Skill_name, Years_experience) Relation Project (Project_id, Start_date, End_date) Relation Skill_used (*Employee_id, *Skill_name, *Project_id) Extended entity relationship model:

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

Example 32 For the relationship Sells, we might have a relationship set like: BarBeer Joe’s BarBud Joe’s BarMiller Sue’s BarBud Sue’s BarPete’s Ale Sue’s BarBud Lite

Example 33 Bars Beers Drinkers name addr manf nameaddr license Preferences

A Typical Relationship Set 34 BarDrinker Beer Joe’s BarAnnMiller Sue’s BarAnnBud Sue’s Bar AnnPete’s Ale Joe’s BarBobBud Joe’s Bar BobMiller Joe’s Bar CalMiller Sue’s Bar CalBud Lite

35 Your Assignment Build Entity-relationship model Relation Order (Order_code, Order_type, Our_reference, Order_date, Approved_date, *Head, *Supplier_code) Relation Supplier (Supplier_code, Supplier_name) Relation Product (Product_code, Product_description) Relation Department (Department_code, Department_name) Relation Head (Head, *Department_code, Title) Relation Order_Product (*Order_code, *Product_code, Qty, Others, Amount) Relation Note (*Order_code, Sequence#, Note) where underlined are primary keys and prefixed with ‘*’ are foreign keys.