개체
개체 타입(개체 집합)
Relationship 관계성
관계성 타입(관계성 집합)
관계성 집합 속성
simple attribute 단순 속성
composite attribute 복합 속성
- 이름 : First_name, Middle_name, Last_name
single-valued attribute 단일값 속성
multivalued attribute 다수값 속성
2023.11.06
ER model의 결과물
사각형 : 개체 집합
마름모형 : 관계성 집합
밑줄 : primary key
complex attributes
date : 관계성 집합 속성
Cardinality Constraints
one
의미many
의미Many-to-one
Many-to-many
Participation Constraints
total participation(==) : 모든 인스턴스가 관계에 참여해야함
→ 어떤 인스턴스도 관계없이 존재 X
partial participation(—) : 일부 인스턴스만 관계에 참여 가능
→ 관련없이 존재 O
→ 수강하지 않는 학생 존재 O
→ 학생이 수강하지 않는 과목 존재 X
3진 관계성 ER 다이어그램
Cardinality Constraints
role 표시 필요 !
참여에 대한 의미를 구분하기 위해
Strong entity set : 모두 자체적으로 primary key 소유
Weak entity set : primary key가 없는 개체 집합
Identifying relationship
many
one
Keys of Weak Entity Sets
Example>
2023.11.09
M:N Relationship Sets
N:1 Relationship Sets
people(pID, name, address, age)
own(pID, vehicleID, registrationDate)
//many측 주키가 own의 주키가 된다.
car(vehicleID, make, model, year, color)
people(pID, name, address, age)
car(vehicleID, make, model, year, color, registrationDate, pID)
//관계성에 참여하지 않는 car 터플의 pID = NULL
1:1 Relationship Sets
people(pID, name, address, age)
own(pID, vehicleID, registrationDate)
// 주키는 pID 또는 vehicleID
car(vehicleID, make, model, year, color)
people(pID, name, address, age)
car(vehicleID, make, model, year, color, registrationDate, pID)
people(pID, name, address, age, registrationDate, vehicleID)
car(vehicleID, make, model, year, color)
Employee(ID, firstName, middleNameInitial, lastName,
streetNumber, streetName, aptNumber, city, state, zipCode,
dateOfBirth, age)
employeePhone(ID, phoneNumber)
2023.11.13
entity set : 객체의 그룹
relationship set : 이러한 엔티티들 간의 관계
Redundant Attributes
parenthood 관계성
fatherhood 관계성
Converting Non-binary relationships
다수 개의 이진 관계성으로 변환 가능
새로운 객체 집합 생성 후 다진 관계성 집합에 속하는 관계성에 대응하는 개체 및 관계성 생성
R (ai, bi, ci)
→ RA 에 (ei, ai) 추가
→ RB 에 (ei, bi) 추가
→ RC 에 (ei, ci) 추가
원래의 관계 완전히 표현 X
disjoint
상위 개체가 하위 개체 하나에만 속함
overlapping
상위 개체가 다수 개의 하위 개체에 속함
Total
모든 상위 수준 엔티티가 반드시 하나 이상의 하위 수준 엔티티에 속함
모든 인스턴스는 특정 하위 분류에 포함
Partial
모든 상위 개체 인스턴스가 하위 개체에 속할 필요 X (defualt)
어떤 인스턴스는 하위 분류에 포함되지 않을 수 있음
스키마로 변환하는 방법
하위 개체 = 하위 개체에만 속하는 속성 + 상위 개체의 주 키
people(ID, name, address)
student(ID, totalCredit)
employee(ID, salary)
하위 개체 = 상속받은 모든 속성 + 해당 개체에만 적용되는 속성
people(ID, name, address)
student(ID, name, address, totalCredit)
employee(ID, name, address, salary)
→ total 참여조건 명시 필요