Database - DDL (Data Definition Language) - create,alter,drop,rename,..๐ŸŠ

ํ™”์ดํ‹ฐ ยท2024๋…„ 1์›” 2์ผ
0

Database

๋ชฉ๋ก ๋ณด๊ธฐ
5/8


  1. ํ…Œ์ด๋ธ”์˜ ์ž๋ฃŒํ˜•
  2. ํ…Œ์ด๋ธ” ์ƒ์„ฑํ•˜๊ธฐ
  3. ํ‹ฐ์ด๋ธ” ์ˆ˜์ •ํ•˜๊ธฐ

1. ํ…Œ์ด๋ธ”์˜ ์ž๋ฃŒํ˜•




2. ํ…Œ์ด๋ธ” ์ƒ์„ฑํ•˜๊ธฐ (CREATE)



3. ํ…Œ์ด๋ธ” ์ˆ˜์ •ํ•˜๊ธฐ (ALTER)




์ œ์•ฝ์กฐ๊ฑด

  • CONSTRAINTS
  • NOT NULL
  • UNIQUE KEY (UK): UNIQUE
  • CHECK
  • PRIMARY KEY (PK): NOT NULL + UNIQUE

  • FOREIGN KEY (FK)

3. ํ…Œ์ด๋ธ” ์‚ญ์ œํ•˜๊ธฐ (DROP)



4. SEQUENCE VIEW

  • SEQUENCE๋ž€? ์—ฐ์†์ ์ธ ์‚ฌ๊ฑด์ด๋ผ๋Š” ๋œป์ด๋ฉฐ, ์ž๋™์œผ๋กœ ์ฆ๊ฐ€ํ•˜๋Š” ๊ฐ’์„ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ฐ์ฒด


  • VIEW ๋ž€? ์ผ์ข…์˜ ๊ฐ€์ƒํ…Œ์ด๋ธ”์„ ์˜๋ฏธ, ํ…Œ์ด๋ธ”๊ณผ ๋‹ค๋ฅด๊ฒŒ ๋ฌผ๋ฆฌ์ž‘์œผ๋กœ ์กด์žฌ X
    ํ•˜์ง€๋งŒ~~ ์‚ฌ์šฉ์ž์—๊ฒŒ๋Š ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผ๋จ
    ์ •๋ณด ๋ณด์•ˆ ์ธก๋ฉด์—์„œ ์œ ๋ฆฌํ•˜๋‹ค๋Š” ์žฅ์ 
    ๋ณดํ†ต ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์ฟ ใ…๋ฆฌ๋ฅผ ๋ทฐVIEW์— ์ €์žฅํ•˜์—ฌ ์‚ฌ์šฉ



    ์—…๋กœ๋“œ์ค‘..
profile
์—ด์‹ฌํžˆ ๊ณต๋ถ€ํ•ฉ์‹œ๋‹ค! The best is yet to come! ๐Ÿ’œ

0๊ฐœ์˜ ๋Œ“๊ธ€