Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Ch.1 Introduction Ch.5 E-R Model (3) example."— Presentation transcript:

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

2 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

3 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

4 ERD to Relations mapping (3)
Ch.1 Introduction ERD to Relations mapping (3) Steps in the Textbook (pp ) 단계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

5 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

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

7 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

8 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

9 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

10 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

11 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

12 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


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

Similar presentations


Ads by Google