| 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 |