Set-Difference operation – 차집합 |
Set Difference operation 차집합 => r – s - 차집합 연산을 사용하면 한 relation엔 있지만 다른 relation에는 없는 튜플을 찾을수있음 - 차집합 연산으로 교집합 구할 수 있음 --> r ∩ s = r – (r – s) = s – (s – r) * 유니온 호환성 성립되어야 차집합 성립 Q) find all courses taught in the Fall 2017 semester, but not in the Spring 2018 semester => π course_id (σ semester=”Fall” ^ year=2017 (section)) – π course_id (σ semester=”Spring” ^ year=2018 (section)) |
Assign -ment operation <- 할당문 |
The assignment operation 할당문 => Physics <- σ dept_name = “Physics” (instructor) - 일시적인 관계 변수에 일부를 할당해 관계대수식을 작성하는 게 편리함 //길면 보기 힘듦 - 할당 작업은 <- 로 표시됨. 프로그래밍 언어의 할당문st Q) find all instructor in the “Physics” and “Music” department => Physics <- σ dept_name = “Physics” (instructor) Music <- σ dept_name = “Music” (instructor) Physics ∪ Music - 할당연산을 이용해서, 쿼리를 일련의 할당으로 구성된 순차적 프로그램으로 작성한 다음, 쿼리 결과 값이 표시되는 표현식으로 작성할 수 있음. |
'데이터베이스설계' 카테고리의 다른 글
[데이터베이스설계] 2-9 세타조인, 자연조인, 디비전 연산자 ÷ (0) | 2024.11.18 |
---|---|
[데이터베이스설계] 2-8 rename, 동일한 쿼리들 (0) | 2024.11.17 |
[데이터베이스설계] 2-6 합집합, 교집합 (2) | 2024.11.15 |
[데이터베이스설계] 2-5 Cartesian, Join operation (2) | 2024.11.14 |
[데이터베이스설계] 2-4 Select, Project (0) | 2024.11.13 |