Search

7 : Database Design Using The E-R Model

course
last review
2023/04/16
mastery
intermediate
progress
not started
date
2023/04/04
4 more properties
Previous chapter

Modeling

데이터베이스는 다음과 같이 모델될 수 있다.
엔티티의 집합
엔티티 간의 관계
Entity는 다른 오브젝트와 구별가능한 오브젝트를 의미한다.(일종의 객체)
Entity는 attributes를 가진다.
Entity set은 같은 성질을 공유하는 같은 타입의 집합을 의미한다.

Relationship Sets

Relationship이란 여러 Entities사이의 관계라고 한다.
44553(Peltier) advisor 22222(Einstein)
student entity / relationship set / instructor entity
Relationship Set은 2개 이상의 엔티티들의 수학적 관계이다.
((e1,e2,en)e1E1,e2E2,,enEn)((e1, e2, … en) | e1 \in E1, e2 \in E2, …, en \in En)
(44553,22222) \in advisor

E-R Diagrams

사각형은 엔티티 집합을 의미한다.
다이아몬드는 Relationship sets를 의미한다.
Attributes는 사각형 엔티티 안에 적혀져있다.
밑줄은 primary key attributes를 의미한다.
Attribute는 Relationship set의 property가 될 수 있다!!!

Degree of a Relationship Set

Binary relationship
두개의 엔티티 셋만 관여한다.
대부분의 Relationships은 binary이다.
세개 이상의 Entity Relationships는 희귀하다.

Attributes

특정 attribute의 값들로 구성되는 Domain
Domain : 각 attributes에 저장된 값
Attribute types
Simple and composite attributes
Single-valued and multivalued
composite attributes VS component attributes

Keys

Super key is a set of attributes that uniquely determines each entity. • (ID, name) is a super key of instructor • A candidate key is a minimal super key • ID is a candidate key of instructor • course_id is a candidate key of course • One of the candidate keys is selected to be the primary key.
여러 candidate key가 존재할 수 있다.

Entity With composite, multivalued and Derived Attributes

Composite Attributes는 각 Component Attribute를 개별적으로 생성함으로써 Flatten out된다.

Roles

Entity Sets of relationship은 distinct하지 않아야 한다.
굳이 두개의 테이블을 따로 그릴 필요가 없다.
course_id와 prereq_id를 role이라 부른다.
두 엔티티 셋이 같은 성질일 경우 필요한 attribute만 적되, 구분이 잘 되도록 역할을 적는 역할이다.

Mapping Cardinality Constraints

Relationship과 Entity가 어떻게 매칭이 될 수 있는가?
(→) : one, ( — ) : many

Participation of an Entity Set in a Relationship Set

Entity set의 모든 엔티티가 최소한 one relationship에 연관되어야 한다.

Alternative Notation for Cardinality Limits

Weak Entity Sets

primary key를 가지지 않은 Entity Set을 weak entity set이라고 부른다.
Weak Entity set은 identifying entity set에 의존한다.
Next chapter