Ch.1 Introduction Ch.5 E-R Model (3) example.

Slides:



Advertisements
Similar presentations
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Advertisements

Week 5 Relational Database Design by ER- -to-Relational Mapping.
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Mapping the ER Model to Relations(1)1 Overview  Mapping entity types  Mapping relationship types  One-to-one  One-to-many  Many-to-many.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Amity School of Engineering & Technology E-R Diagram for a University Enterprise.
Ch 6: ER to Relational Mapping
Transforming ER & EER diagrams into Relations (Chapter 9)
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Entity-Relationship modeling Transparencies
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
6.8 Case Study: E-R for Supplier-and-Parts Database
Converting ER model Into Relational Table
Ch.5 Entity-Relationship Model (1) Peter P. Chen 1976.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Entity-Relationship Model Ch. 3
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
1 E/R to relational mapping algorithm – overview Mapping algorithm step 1-7 Steen Jensen, autumn 2013.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
CS 370 Database Systems Lecture 9 The Relational model.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
Slide Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
1 CS 430 Database Theory Winter 2005 Lecture 15: How to Convert an ER Model to Relations.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
Software School of Hunan University Database Systems Design Part III : Mapping ER Diagram to Relational Schema.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Logical Database Design and the Relational Model.
ER- Relational Mapping (Based on Chapter 9 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Transforming ER models to relational schemas
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Mapping ER Diagrams to Tables
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Introduction to Database Systems
Lecture (8) 1. Relational Database Design by ER- and EERR- to-Relational Mapping 2.
Conceptual Modelling The Entity-Relationship (ER) Model The ER diagram Data Modelling.
Ch.2 Relational Data Model E. F. Codd (1969, 1970)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER- to-Relational Mapping.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Chapter 4+17 The Relational Model Pearson Education © 2014.
Relational Database Design (Top Down)
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

Ch.1 Introduction Ch.5 E-R Model (3) example

ERD to Relations mapping (1) Ch.1 Introduction ERD to Relations mapping (1) Entities  relation Relationship One-to-one separate relation include one key attribute in the relation of the other entity (key of the entity with partial participation in the relation of the entity with total participation) One-to-many Include key attribute of one side entity in the relation of many side entity Many-to-many  separate relation Ch5 E-R Model (3) Database System

ERD to Relations mapping (2) Ch.1 Introduction ERD to Relations mapping (2) Example 교수(직번, 교수이름, 주소), 연구실(연구실번호) 학생(학번, 학생이름, 주소), 과목(과목번호, 과목명, 개설학과) Relationship 교수 사용 연구실 (1:1, 교수 total participation) 연구실사용(직번, 연구실번호) 연구실(연구실번호, 교수직번) 교수(직번, 교수이름, 주소, 연구실번호) 교수 지도 학생 (1:M) 학생지도(교수직번, 학생학번) 학생 (학번, 학생이름, 주소, 지도교수) 학생 수강 과목 수강 (학번, 과목번호, 성적) Ch5 E-R Model (3) Database System

ERD to Relations mapping (3) Ch.1 Introduction ERD to Relations mapping (3) Steps in the Textbook (pp. 299-310) 단계1 : regular entity type & single-valued attribute 단계2 : weak entity type & single-valued attribute 단계3 : binary 1:1 relationship 단계4 : binary 1:N relationship 단계5 : binary M:N relationship 단계6 : N-ary relationship 단계7 : multi-valued attribute Ch5 E-R Model (3) Database System

Entity-Relationship diagram Ch.1 Introduction Entity-Relationship diagram 이름 직책 역할 프로젝트번호 공급자번호 급여 사원번호 Start_Time 프로젝트이름 공급자이름 시 프로젝트 관리 근무 공급자 부품 공급 구성 부양가족 부양 부서 소속 사용 사원 M N L 1 예산 주소 구 신용도 위치 동 N 공급량 Start_Time 성별 사용갯수 부양가족이름 부품번호 numincluded 층번호 부품이름 부서번호 부서이름 가격 Ch5 E-R Model (3) Database System

Entities Entities 1& 2 사원 3. 부양가족 4. 프로젝트 5. 부서 6. 부품 7. 공급자 Ch.1 Introduction Entities Entities 1& 2 사원 3. 부양가족 4. 프로젝트 5. 부서 6. 부품 7. 공급자 (사원번호, 이름, 직책, 급여, 주소(시, 구, 동) ) (부양가족이름, 성별) (프로젝트번호, 프로젝트이름, 예산, multi-valued 위치) (부서번호, 부서이름, 층번호) (부품번호, 부품이름, 가격, multi-valued subpart) (공급자번호, 공급자이름, 신용도) Ch5 E-R Model (3) Database System

Example 단계1 : regular entity type & single-valued attributes Ch.1 Introduction Example 단계1 : regular entity type & single-valued attributes 사원, 프로젝트, 부서, 부품, 공급자 Employee (EMPNO, EmpName, JobTitle, Salary, City, Ku, Dong) Project (PROJNO, ProjName, Budget, ???) Department (DEPTNO, DeptName, floor) Part (PARTNO, PartName, Price, ???) Supplier (SUPPNO, SuppName, Credit) 단계2 : weak entity type & single-valued attribute Dependent (DepnName, Sex) Ch5 E-R Model (3) Database System

Relationships 3. 부양 (부양가족–사원) N:1, = - 4. 근무 (프로젝트–사원) M:N, = - Ch.1 Introduction Relationships 3. 부양 (부양가족–사원) N:1, = - 4. 근무 (프로젝트–사원) M:N, = - 관리 (프로젝트–사원) 1:1, = - 5. 소속 (부서–사원) 1:N, = = 6. 사용 (프로젝트–부품) M:N, - - 구성 (부품–부품) 7. 공급 3-ary (공급자–부품–프로젝트) L:M:N - - - (사원번호, 부양가족이름) (사원번호, 프로젝트번호, 역할, Start_Time) (사원번호, 프로젝트번호, (사원번호, 부서번호) (프로젝트번호, 부품번호, 사용갯수) (부품번호, Child부품번호, numincluded) (공급자번호, 부품번호, 프로젝트번호, 공급량) Ch5 E-R Model (3) Database System

Example (2) 단계3 : binary 1:1 relationship Ch.1 Introduction Example (2) 단계3 : binary 1:1 relationship Project (PROJNO, ProjName, Budget, Manager, Start_Time, ???) 단계4 : binary 1:N relationship Dependent (EMPNO, DepnName, Sex) Employee (EMPNO, EmpName, JobTitle, Salary, City, Ku, Dong, DEPTNO) 단계5 : binary M:N relationship 근무, 사용, 구성 Work_For (EMPNO, PROJNO, Role, Start_Time) PartUse (PROJNO, PARTNO, numUsed) PartStruct (PARTNO, ChildPNO, numincluded) Part (PARTNO, PartName, Price) Ch5 E-R Model (3) Database System

Example (3) Final Result 단계6 : N-ary relationship Ch.1 Introduction Example (3) 단계6 : N-ary relationship Supply (SUPPNO, PARTNO, PROJNO, quantity) 단계7 : multi-valued attribute PROJ_LOC (PROJNO, Location) Project (PROJNO, ProjName, Budget , Manager, Start_Time) Final Result Employee (EMPNO, EmpName, JobTitle, Salary, City, Ku, Dong, DEPTNO) Dependent (EMPNO, DepnName, Sex) Project (PROJNO, ProjName, Budget, Manager, Start_Time) Ch5 E-R Model (3) Database System

Example (4) Final Result Department (DEPTNO, DeptName, floor) Ch.1 Introduction Example (4) Final Result Department (DEPTNO, DeptName, floor) Part (PARTNO, PartName, Price) Supplier (SUPPNO, SuppName, Credit) Work_For (EMPNO, PROJNO, Role, Start_Time) PartUse (PROJNO, PARTNO, numUsed) PartStruct (PARTNO, ChildPNO, numincluded) Supply (SUPPNO, PARTNO, PROJNO, quantity) PROJ_LOC (PROJNO, Location) Ch5 E-R Model (3) Database System

Example (5) Result differences from Textbook Ch.1 Introduction Example (5) Result differences from Textbook In Work_For relationship, the textbook uses Duration instead of Start_Time Work_For (EMPNO, PROJNO, Role, Start_Time) Text : Work_For (EMPNO, PROJNO, Role, Duration) PartStruct is included in Part relation in the textbook PartStruct (PARTNO, ChildPNO, numincluded) Text : Part (PARTNO, PartName, Price, Subpartno) PartUse is included in Supply relation in the textbook PartUse (PROJNO, PARTNO, numUsed) Text : Supply (SUPPNO, PARTNO, PROJNO, quantity) Ch5 E-R Model (3) Database System