2 1 46 n customer account depositor accessdate

  • Slides: 36
Download presentation

2. 1 기본 개념(4/6) n 관계집합 – 속성은 또한 관계 집합의 속성일 수도 있다.

2. 1 기본 개념(4/6) n 관계집합 – 속성은 또한 관계 집합의 속성일 수도 있다. 예를 들어, customer와 account개체 집합간의 depositor 관계 집합에 속성 access-date 가짐 social-security customer-street customer-name access-date account-number balance customer-city customer depositor 컴퓨터멀티미디어학과 DBLab account 7

2. 2 제약조건(2/5) n 일 대 일 관계 social-security customer-street customer-name customer – –

2. 2 제약조건(2/5) n 일 대 일 관계 social-security customer-street customer-name customer – – loan-number amount customer-city borrower loan 고객은 관계 borrower를 통해 하나의 대출과 연관. 대출은 borrower를 통해 하나의 고객과 연관. 컴퓨터멀티미디어학과 DBLab 11

2. 2 제약조건(3/5) n 일 대 다 및 다 대 일 관계 social-security customer-street

2. 2 제약조건(3/5) n 일 대 다 및 다 대 일 관계 social-security customer-street customer-name amount customer-city customer social-security loan-number (a) borrower customer-street customer-name customer loan-number amount customer-city (b) borrower 컴퓨터멀티미디어학과 DBLab loan 12

2. 2 제약조건(5/5) n 다 대 다 관계 social-security customer-street customer-name customer loan-number amount

2. 2 제약조건(5/5) n 다 대 다 관계 social-security customer-street customer-name customer loan-number amount customer-city borrower loan – 고객은 borrower를 통해 여러(0 가능) 대출과 연관. – 대출은 borrower를 통해 여러(0 가능) 고객과 연관. 컴퓨터멀티미디어학과 DBLab 14

약 관계 집합(3/3) n 약 개체 집합 – 약 개체 집합은 이중 사각형으로 표현.

약 관계 집합(3/3) n 약 개체 집합 – 약 개체 집합은 이중 사각형으로 표현. – 약 개체 집합의 구별자에는 점선으로 밑줄. n – payment-number - payment 개체 집합의 구별자 payment의 기본 키 - (loan-number, payment-number) payment-date loan-number amount loan payment-number loan-payment 컴퓨터멀티미디어학과 DBLab payment-amount payment 22

2. 7 E-R 모델의 확장 그림 2. 17 세분화와 일반화 account-number balance account ISA

2. 7 E-R 모델의 확장 그림 2. 17 세분화와 일반화 account-number balance account ISA interest-rate savings-account overdraft-amount checking-account ISA standard num-checks gold interest-payment senior min-balance 컴퓨터멀티미디어학과 DBLab date-of-birth 24

2. 7. 5 통합화 n 대출 고객은 대출 담당 직원의 조언 받을 수 있음.

2. 7. 5 통합화 n 대출 고객은 대출 담당 직원의 조언 받을 수 있음. social-security customer-street customer-name loan-number amount customer-city customer borrower loan-officer employee e-social-security telephone-number employee-name 컴퓨터멀티미디어학과 DBLab 27

통합화의 예 social-security customer-street customer-name amount loan-number customer-city borrower customer loan-officer employee e-social-security telephone-number

통합화의 예 social-security customer-street customer-name amount loan-number customer-city borrower customer loan-officer employee e-social-security telephone-number employee-name 컴퓨터멀티미디어학과 DBLab 29

은행 기관의 E-R도 branch-city branch-name assets branch loan-number customer-street customer-name payment-date loan-branch social-security payment-amount

은행 기관의 E-R도 branch-city branch-name assets branch loan-number customer-street customer-name payment-date loan-branch social-security payment-amount payment-number customer-city customer borrower loan access-date loan-payment account-number payment balance type cust-banker depositor account manager employee works-for worker e-social-security dependent-name employment-length ISA employee-name telephone-number start-date savings-account interest-rate 컴퓨터멀티미디어학과 DBLab checking-account overdraft-amount 31

일반화를 테이블로 표현 n 방법 1 : 일반화 개체 account에 대한 테이블 작성 일반화되는

일반화를 테이블로 표현 n 방법 1 : 일반화 개체 account에 대한 테이블 작성 일반화되는 각 개체 집합에 대한 테이블 작성(일반화 개체 집합의 주 키 포함) 테이블 account savings-account checking-account n 테이블 속성 account-number, balance, account-type account-number, interest-rate account-number, overdraft-amount 방법 2 : 일반화되는 각 개체 집합에 대한 테이블 작성 테이블 savings-account checking-account 테이블 속성 account-number, balance, interest-rate account-number, balance, overdraft-amount 방법 2에서는 일반화 개체 account에 대한 테이블이 없다. 컴퓨터멀티미디어학과 DBLab 33

통합화에 상응하는 릴레이션 customer-name cust-social-security customer-street customer-city loan-number amount borrower cust-social-security loan-number employee emp-social-security

통합화에 상응하는 릴레이션 customer-name cust-social-security customer-street customer-city loan-number amount borrower cust-social-security loan-number employee emp-social-security employee-name phone-number loan-officer emp-social-security cust-social-security loan-number 컴퓨터멀티미디어학과 DBLab 34

개체 집합을 테이블로 표현 n 강 개체 집합은 같은 속성을 가진 테이블로 변환 customer-name

개체 집합을 테이블로 표현 n 강 개체 집합은 같은 속성을 가진 테이블로 변환 customer-name Jones Smith Hayes social-security 321 -12 -3123 019 -28 -3746 677 -89 -9011 c-street Main North Main c-city Harrison Rye Harrison customer 테이블 n 약 개체 집합은 강 개체 집합을 식별하는 주 키의 행을 포함 한 테이블이 된다 loan-number L-17 L-23 L-15 payment-number 5 11 22 payment-date payment-amount 10 May 1996 50 17 May 1996 75 23 May 1996 300 payment 테이블 컴퓨터멀티미디어학과 DBLab 35