๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์„ค๊ณ„

[๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์„ค๊ณ„] 2-8 rename, ๋™์ผํ•œ ์ฟผ๋ฆฌ๋“ค

by ์ ผ์ ผ39 2024. 11. 17.
Rename
operation
ρ
๊ฐœ๋ช…
Rename operation ๊ฐœ๋ช… => ρ X(A1, A2, … An) (๋ฆด๋ ˆ์ด์…˜R)   // ρ X (๋ฆด๋ ˆ์ด์…˜R), ρ X(A1, A2, … An) (๋ฆด๋ ˆ์ด์…˜R)
-      ๊ด€๊ณ„ ๋Œ€์ˆ˜์‹์˜ ๊ฒฐ๊ณผ์—๋Š” ์ด๋ฅผ ์ฐธ์กฐํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์ด๋ฆ„์ด ์—†์Œ๊ทธ๋ž˜์„œ ์ด๊ฑธ ์”€
-      ρ X (์ž„์˜์˜ ๊ด€๊ณ„๋Œ€์ˆ˜ ์—ฐ์‚ฐ์œผ๋กœ ํ˜•์„ฑ๋œํ•ฉ์ง‘ํ•ฉ, PROJECT, SELECT ์žˆ์„ ์ˆ˜ ์žˆ์Œ..) ์ด๊ฑธ x๋กœ
์นดํ‹ฐ์…˜ ๊ณฑ์„ ํ•  ๋•Œ, ๊ฒฝ์šฐ์— ๋”ฐ๋ผ ๊ฐ™์€ relation์„ ๊ณฑํ•˜๋ฉด ์ด๋ฆ„ ์ค‘๋ณต๋˜๋‹ˆ๊นŒ ๋‘˜ ์ค‘ ํ•˜๋‚˜ ๊ฐœ๋ช…
๋™์ผํ•œ
์ฟผ๋ฆฌ๋“ค
Q) find information in the Physics department with salary greater than 90,000
   => σ dept=”Physics” ^ salary > 90,000 (instructor)
   => σ dept_name=”Physics” ( σ salary > 90,000 (instructor))
 
Q) find information about courses taught by instructors in the Physics department
   => σ dept_name=”Physics” (instructor โจ instructor.ID = teaches.ID teaches)   //instructor, teaches ์กฐ์ธํ›„ select
   => ( σ dept_name=”Physics” (instructor) ) โจ instructor.ID = teaches.ID teaches
 
๋‘ ์ฟผ๋ฆฌ๋Š” ๋™์ผํ•˜์ง€๋Š” ์•Š์ง€๋งŒ(not identical); ๋™๋“ฑํ•˜๋‹ค(equivalent) – ๋ชจ๋“  ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋™์ผ๊ฒฐ๊ณผ
 
ํ…Œ์ด๋ธ”์ด๋ผ๋Š” ์ž๋ฃŒ๊ตฌ์กฐ์— ๋“ค์–ด์žˆ๋Š” ๋ฐ์ดํ„ฐ ์ค‘ ์›ํ•˜๋Š” ๊ฑธ ๊ฒ€์ƒ‰ํ•˜๊ธฐ ์œ„ํ•ด ๊ด€๊ณ„๋Œ€์ˆ˜์—ฐ์‚ฐ์ž ์‚ฌ์šฉ
๊ทธ ๊ด€๊ณ„๋Œ€์ˆ˜์—ฐ์‚ฐ์ž ํ•˜๋‚˜๋งŒ์œผ๋กœ ์›ํ•˜๋Š” ๋‚ด์šฉ ๋ฝ‘์•„๋‚ผ ์ˆ˜ ์—†์–ด์„œ ๊ด€๊ณ„๋Œ€์ˆ˜์‹์ด ์ƒ๊น€
      -> relation์— ๋Œ€ํ•ด ์—ฐ์‚ฐํ•ด์„œ relation์„ ์–ป๊ฒŒ ๋จ