ER-Model

세미·2022년 10월 13일
0

데이터베이스

목록 보기
2/9

ER Model

  • models an enterprise as a collection of entities and realtionships.

개체 (Entity)

  • 단독으로 존재하는 존재. distinguishable
  • Described by a set of attributes

관계 (Relationship)

  • entity 간 관계를 표현
  • 마름모로 표현
  • realtionship set : mathematical relation among "n>=2" entities, each taken from entity sets
    ex) (44553,2222) ∈ advioser <-realtionship

Binary realtionship

  • involve two entity sets

  • most relationship sets in a database system are binary.

  • Attribute를 통해 entity type을 정의했다면 realtionship을 통해 entity type 간의 관계를표현.

카디널리티 비율 제약조건 (Cardinality Ratio Constraint)

  • 관계를 맺는 두 entity type에 대해, 한개체가 얼마나 많은 다른개체와 관련될 수 있는지 나타내는 제약조건.

  • Express the number of entites to which anoter entity can be associated via a realtionship set

    1. one to one : 일처일부제 + 화살표로 표시 (→)
    2. one to many : 부모->자식관계.부모는 자식을 1명뿐 아니라 2,3명 있을 수 있다. + 일반 직선으로 표시
    3. many to one : 자식 -> 부모 관계
    4. many to many : 쇼핑몰에서 회원과 상품의 관계.

total participation(전체참여)

  • indicated by double line (굵은선 사용)
  • every entity in the entity set participated in at least one ralationship in the ralationship set
  • =모든 entity 가 적어도 한개의 entity 와 관계가 있다는 것을 의미.
    ex) 모든 학생들은 지도교수 존재.

Role name

  • realtionship instace에 대해서 entity type의 특정 entity가 수행하는 역할.

속성 (attribute)

  • 개체가 갖는 속성

key attribute

  • 다른객체들과 중복되지 않는 고유한 값을 가진 attribute. 약간 primary key 재질
  • 주로 객체를 식별하는데 사용.

Composite attribute

  • 독립적인 attribute들이 모여서 생성된 attribute.
    ex) name이란 attribute 존재. 이때 name을 first_name, middle_initial, last_name으로 표현할 수 있음.
    ----> name은 독립된 attribute들이 모여 생성되었으므로 composite attribute라고 할 수 있다.

Derived attribute

  • 다른 attribute가 갖고 있는 값으로 부터 계산되어져 나온 attribute.

약한개체(Weak Entity)

  • key attribute가 없는 entity type.
    ex) 학사 관리 시스템에서 강의번호 100은 100-1, 100-2 처럼 '분반'이 존재한다고 하자. 이때 '분반'이라는 개체는 자신의 key attribute가 없으며 강의테이블에 의존해야함. 그러므로 '분반'은 약한 개체. 분반이 존재하기 위해서는 꼭 Course Entity type가 있어야 한다.
  • Owner Entity Type인 Course Entity type의 key 와 합쳐서 표현되어야함.
  • 약한개체는 두개의 네모로 표현.
  • 부분키는 점선으로 된 밑줄로 표현.
  • entity type이 약한 개체와 관계를 맺을 때는 식별 관계성 타입으로 표현.-> 두개의 마름모로 표현.
  • 약한개체는 항상 의존적이기 때문에 전체참여야 한다.

출처
그림출처

0개의 댓글