Union operation ∪ 합집합 |
Union operation => 릴레이션R ∪ 릴레이션S = 2개의 relation(투플의 집합)들을 결합… //중복 제거됨 * r, s가 합집합 연산이 되기 위해 만족해야 하는 조건 [유니온 호환성 union compatibility] (1) r, s는 동일한 arity(컬럼의 수)을 가져야 한다 (2) 속성 도메인(해당컬럼에 등장가능한 값의 집합=컬럼데이터타입)이 compatible(호환)되어야 함. (예: r의 두번째 column은 s의 두번째 column과 같은 타입이어야 함) Q) find all courses id taught in the Fall 2017 semester, or in the Spring 2018 semester. Or in both => π course_id (σ semester=”Fall” ^ year=2017 (section)) ∪ π course_id (σ semester=”Spring” ^ year=2018 (section)) |
Set-inter -section operation ∩ 교집합 |
Set-Intersection operation 교집합 => r ∩ s * 유니온 호환성이 성립되어야 교집합도 성립함 Q) find the set of all courses taught in both the Fall 2017 and the Spring 2018 semesters => π course_id (σ semester=”Fall” ^ year=2017 (section)) ∩ π course_id (σ semester=”Spring” ^ year=2018 (section)) |
'데이터베이스설계' 카테고리의 다른 글
[데이터베이스설계] 2-8 rename, 동일한 쿼리들 (0) | 2024.11.17 |
---|---|
[데이터베이스설계] 2-7 차집합, 할당문 (2) | 2024.11.16 |
[데이터베이스설계] 2-5 Cartesian, Join operation (2) | 2024.11.14 |
[데이터베이스설계] 2-4 Select, Project (0) | 2024.11.13 |
[데이터베이스설계] 2-3 관계대수 개념 (0) | 2024.11.12 |