๐ ์ ๊ณต ๊ณต๋ถ/DB๊ธฐ์ด14 [DB] SQL ๋ฌด๊ฒฐ์ฑ ์ ์ฝ์กฐ๊ฑด ์๋ฐฐ ์์ company DB ์ฐ์ต๋ฌธ์ ๋ค. ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ๊ต์ก์ฉ ์๋ฃ๋ก ํํ๊ฒ ์ฐ์ด๋ ๋ฏ ํ๋ค ๐ก [ ๊ฐ์ฒด ๋ฌด๊ฒฐ์ฑ : ํค๊ฐ์ด null์ด๋ฉด ์๋จ ] [ ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ : FK๊ฐ PK์ ์๋ ๊ฐ์ด๋ฉด ์๋จ ] ๋ค์ ๋ช ๋ น์ด ์ด๋ค ๋ฌด๊ฒฐ์ฑ์ ์๋ฐํ๋์ง ์ค๋ช ํ์์ค. 1) Insert into PROJECT. → DNUM=2์ด๊ณ DNUMBER=2์ DEPACTION ๊ด๊ณ์ ํํ์ด ์์ผ๋ฏ๋ก ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ์ ์๋ฐ. (์ฐธ์กฐํ ์ ์๋ FK๊ฐ 2๋ฅผ ๊ฐ์ง๊ฒ ๋๋ฏ๋ก) ์ ํ ๋ฐฉ๋ฒ (i) ์ ํ๋ก์ ํธ ํํ ์ฝ์ ๊ฑฐ๋ถ (ii) ๋ถ์ ๊ด๊ณ์์ ์ ๊ท ํ๋ก์ ํธ ํํ์ DNUM ๊ฐ์ ๊ธฐ์กด DNUMBER ๊ฐ์ผ๋ก ๋ณ๊ฒฝ (iii) DNUMBER=2์ ์ ๋ถ์ ํํ์ ์ฝ์ ํฉ๋๋ค. 2) Insert into WORKS_ON. → ๊ฐ์ฒด ๋ฌด๊ฒฐ์ฑ ๋ฐ ์ฐธ์กฐ ๋ฌด๊ฒฐ์ฑ์ .. 2022. 10. 20. [DB] Schema, DDL, DML ์ ๋ฆฌ The goal of Three-schema architecture is to separate the user applications and the physical DB. → ๋ชฉํ = ์ฌ์ฉ์ ์ ํ๋ฆฌ์ผ์ด์ ๊ณผ ๋ฌผ๋ฆฌ์ DB๋ฅผ ๋ถ๋ฆฌํ์ฌ DB์ ๋ ๋ฆฝ์ฑ ํ๋ณด. Internal schema describes the physical storage structure of the DB. Conceptual schema describes the structure of the whole DB for a community of users. External schema describes the part of the DB that a particular user group is interested in and hides the r.. 2022. 10. 20. ์ด์ 1 2 3 ๋ค์ 728x90 ๋ฐ์ํ