DELETE


DELETE FROM dbtable;
DELETE FROM dbtable WHERE {์กฐ๊ฑด};
ROLLBACK;
COMMIT;
  • WHERE ๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ํ…Œ์ด๋ธ”์— ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•˜๋‚˜ํ•˜๋‚˜ ์„ ํƒํ•˜์—ฌ ์ œ๊ฑฐํ•˜๋Š” ๋ฐฉ์‹
  • WHERE ๋ฌธ์„ ์‚ฌ์šฉํ•˜์ง€์•Š๊ณ  ํ…Œ์ด๋ธ”์˜ ๋ชจ๋“  ๋ฐ์ดํ„ฐ๋ฅผ ์‚ญ์ œํ•˜๋”๋ผ๋„, ๋‚ด๋ถ€์ ์œผ๋กœ๋Š” ํ•œ์ค„ ํ•œ์ค„ ์ผ์ผํžˆ ์ œ๊ฑฐํ•˜๋Š” ๊ณผ์ •์„ ๊ฑฐ์นจ
  • ์ฒ˜๋ฆฌ์†๋„๊ฐ€ ๋Šฆ๊ณ  ํผํฌ๋จผ์Šค์— ์ข‹์ง€์•Š์€ ์˜ํ–ฅ์„ ์ค„ ์ˆ˜ ์žˆ์Œ
  • ์›ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋งŒ ๊ณจ๋ผ์„œ ์‚ญ์ œํ•  ๋•Œ๋Š” DELETE ์‚ฌ์šฉ
  • ์ „์ฒด ๋ฐ์ดํ„ฐ ์‚ญ์ œํ•  ๋•Œ๋Š” TRUNCATE ์‚ฌ์šฉ
  • ๋ฐ์ดํ„ฐ๋ฅผ ์‚ญ์ œํ•˜๋”๋ผ๋„ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‹ด๊ฒจ์žˆ๋˜ Storage ๋Š” Release ๋˜์ง€ ์•Š๋Š”๋‹ค
  • DELETE ๋œ ๋ฐ์ดํ„ฐ๋Š” COMMIT ๋˜๊ธฐ ์ „์— ROLLBACK ํ•  ์ˆ˜ ์žˆ์Œ

TRUNCATE


TRUNCATE TABLE dbtable;
  • ์ „์ฒด ๋ฐ์ดํ„ฐ๋ฅผ ํ•œ ๋ฒˆ์— ์‚ญ์ œํ•˜๋Š” ๋ฐฉ์‹
  • ์ตœ์ดˆ ์ƒ์„ฑ๋˜์—ˆ์„ ๋‹น์‹œ์˜ Storage ๋งŒ ๋‚จ๊ธฐ๊ณ  ๋ฐ์ดํ„ฐ๊ฐ€ ๋‹ด๊ฒจ์žˆ๋˜ Storage ๋Š” Release ๋จ
  • TRUNCATE TABLE == CREATE TABLE ํ•œ ์งํ›„์˜ ์ƒํƒœ
  • ์ž๋™ COMMIT ๋˜๋Š” ๋ช…๋ น์–ด์ด๊ธฐ ๋•Œ๋ฌธ์— ์ง€์šด ๋ฐ์ดํ„ฐ๋ฅผ ๋˜๋Œ๋ฆด ์ˆ˜ ์—†์Œ

DROP


DROP TABLE dbtable;
  • ํ…Œ์ด๋ธ” ์ž์ฒด๋ฅผ ์ฒ˜์Œ๋ถ€ํ„ฐ ์—†์—ˆ๋˜ ํ…Œ์ด๋ธ”์ฒ˜๋Ÿผ ์™„์ „ํžˆ ๋‚ ๋ ค๋ฒ„๋ฆฌ๋Š” ๋ฐฉ์‹
  • ํ…Œ์ด๋ธ” ์ž์ฒด๊ฐ€ ๋ชจ๋‘ ์‚ญ์ œ๋˜๋ฉฐ ํ•ด๋‹น ํ…Œ์ด๋ธ”์— ์ƒ์„ฑ๋˜์–ด ์žˆ๋˜ ๋ชจ๋“  ์ธ๋ฑ์Šค๋„ ์‚ฌ๋ผ์ง
  • ์ž๋™ COMMIT ๋˜๋Š” ๋ช…๋ น์–ด์ด๊ธฐ ๋•Œ๋ฌธ์— ์ง€์šด ๋ฐ์ดํ„ฐ๋ฅผ ๋˜๋Œ๋ฆด ์ˆ˜ ์—†์Œ
  • ์˜ค๋ผํด10g ๋ถ€ํ„ฐ๋Š” ํ…Œ์ด๋ธ”์ด ์‚ญ์ œ๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ํœด์ง€ํ†ต ๊ฐœ๋…์ฒ˜๋Ÿผ ์ž ์‹œ ์‚ญ์ œ โ†’ ํ…Œ์ด๋ธ” ์ด๋ฆ„์ด BIN$โ€ฆ ์œผ๋กœ ๋ณ€๊ฒฝ๋จ
DELETETRUNCATEDROP
๋ช…๋ น์–ด ์ข…๋ฅ˜DMLDDLDDL
์ฒ˜๋ฆฌ ์†๋„๋Š๋ฆผ๋น ๋ฆ„๋น ๋ฆ„
COMMIT์ง์ ‘์ž๋™์ž๋™
ROLLBACK ์—ฌ๋ถ€๊ฐ€๋Šฅ๋ถˆ๊ฐ€๋ถˆ๊ฐ€
์‚ญ์ œ ๋ฐฉ์‹๋ฐ์ดํ„ฐ๋งŒ ์‚ญ์ œCREATE ์ƒํƒœํ…Œ์ด๋ธ” ์™„์ „ํžˆ ์ œ๊ฑฐ