{"id":357,"date":"2022-06-28T14:57:47","date_gmt":"2022-06-28T05:57:47","guid":{"rendered":"https:\/\/dozzing.kr\/wordpress\/?p=357"},"modified":"2025-10-24T11:53:02","modified_gmt":"2025-10-24T02:53:02","slug":"mysql-%ec%9d%b4%eb%a1%a0-%ec%a0%95%eb%a6%ac-%ea%b3%84%ec%86%8d-%ec%b6%94%ea%b0%80%eb%90%a0-%ec%98%88%ec%a0%95","status":"publish","type":"post","link":"https:\/\/blog.dozzing.kr\/?p=357","title":{"rendered":"[MYSQL] \uc774\ub860 \uc815\ub9ac &#8211; \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815"},"content":{"rendered":"<h2>1. \ub370\uc774\ud130 \uc815\uc758 \uc5b8\uc5b4 (DDL : Data Definition Language)<\/h2>\n<h6>- \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc815\uc758\ud558\ub294 \uc5b8\uc5b4\uc774\uba70, \ub370\uc774\ud130\ub97c \uc0dd\uc131, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \ub4f1\uc758 \ub370\uc774\ud130\uc758 \uc804\uccb4\uc758 \uace8\uaca9\uc744 \uacb0\uc815\ud558\ub294 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4<\/h6>\n<h6>- DDL\uc5d0\uc11c\ub294 \ub300\ubd80\ubd84 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 \ud14c\uc774\ube14 \uc774\ub984, \uceec\ub7fc \uc774\ub984\uc5d0 \ub300\ud574 \ub530\uc634\ud45c\uac00 \uc544\ub2cc \ubc31\ud2f1(`)\uc73c\ub85c \uac10\uc2f8\uc900\ub2e4. (\uc18d\uc131\uba85\uc740 \ub530\uc634\ud45c \uac00\ub2a5)<\/h6>\n<p>\u00a0<\/p>\n<h3>1 ) CREATE : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc0dd\uc131<\/h3>\n<h6>- \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0dd\uc131<\/h6>\n<pre><code class=\"language-sql line-numbers\">`CREATE DATABASE `DATABASENAME`;`\n<\/code><\/pre>\n<h6>- \ud14c\uc774\ube14 \uc0dd\uc131<\/h6>\n<pre><code class=\"language-sql line-numbers\">`CREATE TABLE `DB_TABLENAME`(\n\u2018\uc18d\uc131\uba85 1\u2019 \ud0c0\uc785,\n\u2018\uc18d\uc131\uba85 2\u2019 \ud0c0\uc785,\n...\n)`\n<\/code><\/pre>\n<p>\u00a0<\/p>\n<h4>\u3131 ) \ud0c0\uc785 \uc885\ub958<\/h4>\n<h6>- \ubb38\uc790\ud615 \ub370\uc774\ud130\ud0c0\uc785<\/h6>\n<table>\n<thead>\n<tr>\n<th>\ub370\uc774\ud130 \uc720\ud615<\/th>\n<th>\uc815\uc758<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CHAR(n)<\/td>\n<td>\uace0\uc815 \uae38\uc774 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 255byte)- \uc9c0\uc815\ub41c \uae38\uc774\ubcf4\ub2e4 \uc9e6\uc740 \ub370\uc774\ud130 \uc785\ub825\ub420 \uc2dc \ub098\uba38\uc9c0 \uacf5\uac04 \uacf5\ubc31\uc73c\ub85c \ucc44\uc6cc\uc9c4\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>VARCHAR(n)<\/td>\n<td>\uac00\ubcc0 \uae38\uc774 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 65535byte)- \uc9c0\uc815\ub41c \uae38\uc774\ubcf4\ub2e4 \uc9e6\uc740 \ub370\uc774\ud130 \uc785\ub825\ub420 \uc2dc \ub098\uba38\uc9c0 \uacf5\uac04\uc740 \ucc44\uc6b0\uc9c0 \uc54a\ub294\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>TINYTEXT(n)<\/td>\n<td>\ubb38\uc790\uc5f4 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 255byte)<\/td>\n<\/tr>\n<tr>\n<td>TEXT(n)<\/td>\n<td>\ubb38\uc790\uc5f4 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 65535byte)<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMTEXT(n)<\/td>\n<td>\ubb38\uc790\uc5f4 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 16777215byte)<\/td>\n<\/tr>\n<tr>\n<td>LONGTEXT(n)<\/td>\n<td>\ubb38\uc790\uc5f4 \ub370\uc774\ud130 \ud0c0\uc785(\ucd5c\ub300 4294967295byte)<\/td>\n<\/tr>\n<tr>\n<td>JSON<\/td>\n<td>JSON \ubb38\uc790\uc5f4 \ub370\uc774\ud130 \ud0c0\uc785 - JSON \ud615\ud0dc\uc758 \ud3ec\ub9f7\uc744 \uaf2d \uc900\uc218\ud574\uc57c \ud55c\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<h6>- \uc22b\uc790\ud615 \ub370\uc774\ud130 \ud0c0\uc785<\/h6>\n<table>\n<thead>\n<tr>\n<th>\ub370\uc774\ud130 \uc720\ud615<\/th>\n<th>\uc815\uc758<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>TINYINT(n)<\/td>\n<td>\uc815\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(1byte) -128 ~ +127 \ub610\ub294 0 ~ 255\uc218 \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>SMALLINT(n)<\/td>\n<td>\uc815\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(2byte) -32768 ~ 32767 \ub610\ub294 0 ~ 65536\uc218 \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMINT(n)<\/td>\n<td>\uc815\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(3byte) -8388608 ~ +8388607 \ub610\ub294 0 ~ 16777215\uc218 \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>INT(n)<\/td>\n<td>\uc815\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(4byte) -2147483648 ~ +2147483647 \ub610\ub294 0 ~ 4294967295\uc218 \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>BIGINT(n)<\/td>\n<td>\uc815\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(8byte) - \ubb34\uc81c\ud55c \uc218 \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>FLOAT(\uae38\uc774, \uc18c\uc218)<\/td>\n<td>\ubd80\ub3d9 \uc18c\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(4byte) -\uace0\uc815 \uc18c\uc218\uc810\uc744 \uc0ac\uc6a9 \ud615\ud0dc\uc774\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>DECIMAL(\uae38\uc774, \uc18c\uc218)<\/td>\n<td>\uace0\uc815 \uc18c\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785\uace0\uc815(\uae38\uc774+1byte) -\uc18c\uc218\uc810\uc744 \uc0ac\uc6a9 \ud615\ud0dc\uc774\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>DOUBLE(\uae38\uc774, \uc18c\uc218)<\/td>\n<td>\ubd80\ub3d9 \uc18c\uc218\ud615 \ub370\uc774\ud130 \ud0c0\uc785(8byte) -DOUBLE\uc744 \ubb38\uc790\uc5f4\ub85c \uc800\uc7a5\ud55c\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<br \/>\n- \ub0a0\uc9dc\ud615 \ub370\uc774\ud130 \ud0c0\uc785<\/p>\n<table>\n<thead>\n<tr>\n<th>\ub370\uc774\ud130 \uc720\ud615<\/th>\n<th>\uc815\uc758<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>DATE<\/td>\n<td>\ub0a0\uc9dc(\ub144\ub3c4, \uc6d4, \uc77c) \ud615\ud0dc\uc758 \uae30\uac04 \ud45c\ud604 \ub370\uc774\ud130 \ud0c0\uc785(3byte)<\/td>\n<\/tr>\n<tr>\n<td>TIME<\/td>\n<td>\uc2dc\uac04(\uc2dc, \ubd84, \ucd08) \ud615\ud0dc\uc758 \uae30\uac04 \ud45c\ud604 \ub370\uc774\ud130 \ud0c0\uc785(3byte)<\/td>\n<\/tr>\n<tr>\n<td>DATETIME<\/td>\n<td>\ub0a0\uc9dc\uc640 \uc2dc\uac04 \ud615\ud0dc\uc758 \uae30\uac04 \ud45c\ud604 \ub370\uc774\ud130 \ud0c0\uc785(8byte)<\/td>\n<\/tr>\n<tr>\n<td>TIMESTAMP<\/td>\n<td>\ub0a0\uc9dc\uc640 \uc2dc\uac04 \ud615\ud0dc\uc758 \uae30\uac04 \ud45c\ud604 \ub370\uc774\ud130 \ud0c0\uc785(4byte) -\uc2dc\uc2a4\ud15c \ubcc0\uacbd \uc2dc \uc790\ub3d9\uc73c\ub85c \uadf8 \ub0a0\uc9dc\uc640 \uc2dc\uac04\uc774 \uc800\uc7a5\ub41c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>YEAR<\/td>\n<td>\ub144\ub3c4 \ud45c\ud604 \ub370\uc774\ud130 \ud0c0\uc785(1byte)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<h6>- \uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785<\/h6>\n<table>\n<thead>\n<tr>\n<th>\ub370\uc774\ud130 \uc720\ud615<\/th>\n<th>\uc815\uc758<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>BINARY(n) &amp; BYTE(n)<\/td>\n<td>CHAR\uc758 \ud615\ud0dc\uc758 \uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 255byte)<\/td>\n<\/tr>\n<tr>\n<td>VARBINARY(n)<\/td>\n<td>VARCHAR\uc758 \ud615\ud0dc\uc758 \uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 65535byte)<\/td>\n<\/tr>\n<tr>\n<td>TINYBLOB(n)<\/td>\n<td>\uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 255byte)<\/td>\n<\/tr>\n<tr>\n<td>BLOB(n)<\/td>\n<td>\uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 65535byte)<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMBLOB(n)<\/td>\n<td>\uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 16777215byte)<\/td>\n<\/tr>\n<tr>\n<td>LONGBLOB(n)<\/td>\n<td>\uc774\uc9c4 \ub370\uc774\ud130 \ud0c0\uc785 (\ucd5c\ub300 4294967295byte)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<h3>2 ) ALTER : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc218\uc815<\/h3>\n<h6>- \uceec\ub7fc \ucd94\uac00<\/h6>\n<pre><code class=\"language-sql line-numbers\">ALTER TABLE `\ucd94\uac00\ud558\uace0\uc790 \ud558\ub294 \ud14c\uc774\ube14 \uc774\ub984` ADD COLUMN `\ucd94\uac00\ud558\uace0\uc790 \ud558\ub294 \uceec\ub7fc \uba85` `\uc18d\uc131\uac12`;\n<\/code><\/pre>\n<h6>- \uceec\ub7fc \uc0ad\uc81c<\/h6>\n<pre><code class=\"language-sql line-numbers\">ALTER TABLE `\uc0ad\uc81c\ud558\uace0\uc790 \ud558\ub294 \ud14c\uc774\ube14 \uc774\ub984` DROP COLUMN `\uc0ad\uc81c\ud558\uace0\uc790 \ud558\ub294 \uceec\ub7fc \uc774\ub984`;\n<\/code><\/pre>\n<h6>- \uceec\ub7fc \uc774\ub984 \ubcc0\uacbd<\/h6>\n<pre><code class=\"language-sql line-numbers\">ALTER TABLE `\ubcc0\uacbd\ud558\uace0\uc790 \ud558\ub294 \uceec\ub7fc\uc774 \uc788\ub294 \ud14c\uc774\ube14 \uc774\ub984` CHANGE COLUMN `\ubcc0\uacbd\ud558\uace0\uc790 \ud558\ub294 \uceec\ub7fc \uba85` `\uc0c8\ub85c\uc6b4 \uceec\ub7fc \uba85` \ubcc0\uacbd\ud558\uace0\uc790 \ud558\ub294 \uc18d\uc131\uac12;\n<\/code><\/pre>\n<h6>- \ud14c\uc774\ube14 \uc774\ub984 \ubcc0\uacbd<\/h6>\n<pre><code class=\"language-sql line-numbers\">ALTER TABLE `\ubcc0\uacbd\ud558\ub824\ub294 \ud14c\uc774\ube14 \uc774\ub984` RENAME `\uc0c8\ub85c\uc6b4 \ud14c\uc774\ube14 \uc774\ub984`;\n<\/code><\/pre>\n<p>\u00a0<\/p>\n<h3>3 ) DROP : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc0ad\uc81c<\/h3>\n<h6>- \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0ad\uc81c<\/h6>\n<pre><code class=\"language-sql line-numbers\">DROP DATABASE `DATABASE NAME`;\n<\/code><\/pre>\n<h6>- \ud14c\uc774\ube14 \uc0ad\uc81c<\/h6>\n<pre><code class=\"language-sql line-numbers\">DROP TABLE `TABLE NAME`;\n<\/code><\/pre>\n<p>\u00a0<\/p>\n<h3>4 ) TRUNCATE : \ud14c\uc774\ube14 \ucd08\uae30\ud654<\/h3>\n<h6>- DELETE\ubb38\uacfc \ub2e4\ub978\uc810 : \uc870\uac74\uc5c6\uc774 \ubaa8\ub450 \uc0ad\uc81c\ud55c\ub2e4\ub294 \uac83<\/h6>\n<pre><code class=\"language-sql line-numbers\">TRUNCATE TABLE [TABLE NAME];\n<\/code><\/pre>\n<p>\u00a0<\/p>\n<h2>2. \ub370\uc774\ud130 \uc870\uc791\uc5b4 (DML : Data Manipulation Language)<\/h2>\n<h6>- \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ub4f1\ub85d\ub41c \ub808\ucf54\ub4dc\ub97c \uc870\ud68c, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \ub4f1\uc758 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4<\/h6>\n<h6>- \ucc98\ub9ac \uc21c\uc11c : WHERE > GROUP BY > HAVING > SELECT > ORDER BY<\/h6>\n<h6>- \uad6c\ubb38 \uc791\uc131 \uc21c\uc11c : SELECT -> FROM -> WHERE -> GROUP BY -> HAVING -> ORDER BY<\/h6>\n<h3>1) SELECT : \ub370\uc774\ud130 \uc870\ud68c<\/h3>\n<h4>\u3131 ) \uae30\ubcf8<\/h4>\n<h6>- \uc804\uccb4 \ub370\uc774\ud130 \uc870\ud68c<\/h6>\n<p><code>SELECT * FROM [TABLE NAME];<\/code><\/p>\n<h6>- \uc6d0\ud558\ub294 \uceec\ub7fc \uc870\ud68c<\/h6>\n<p><code>SELECT [COLUMN1], [COLUMN2], ... FROM [TABLE NAME];<\/code><\/p>\n<h6>- \ucd9c\ub825 \uac1c\uc218 \uc9c0\uc815<\/h6>\n<p><code>SELECT * FROM [TABLE NAME] LIMIT [\uc6d0\ud558\ub294 \uac1c\uc218];<\/code><\/p>\n<h6>- \uc624\ub984\ucc28\uc21c<\/h6>\n<p><code>SELECT [COLUMN1] FROM [TABLE NAME] ORDER BY [\uae30\uc900 \uceec\ub7fc] ASC;<\/code><\/p>\n<h6>- \ub0b4\ub9bc\ucc28\uc21c<\/h6>\n<p><code>SELECT [COLUMN1] FROM [TABLE NAME] ORDER BY [\uae30\uc900 \uceec\ub7fc] DESC;<\/code><\/p>\n<h6>- \uc870\uac74 \uac78\uae30<\/h6>\n<p><code>SELECT [COLUMN1], [COLUMN2], ... FROM [TABLE NAME] WHERE [\uae30\uc900 \uceec\ub7fc] = \u2018\uc870\uac74\uac12\u2019;<\/code><\/p>\n<h6>- AS -> \uceec\ub7fc \uc774\ub984\uc774 AS \ub4a4\uc5d0 \ub098\uc628 \uc774\ub984\uc73c\ub85c \ucd9c\ub825 \ub428.<\/h6>\n<p><code>SELECT [COLUMN1] AS A FROM [TABLE NAME];<\/code><br \/>\n\u00a0<\/p>\n<h4>\u3134 ) \uc9d1\uacc4\ud568\uc218(SUM, AVG, MIN, MAX, COUNT)<\/h4>\n<h5>A ) \uae30\ubcf8<\/h5>\n<p><code>SELECT \uc9d1\uacc4\ud568\uc218(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- SUM : \ud569\uc0b0<\/h6>\n<p><code>SELECT SUM(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- AVG : \ud3c9\uade0<\/h6>\n<p><code>SELECT AVG(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- MIN : \ucd5c\uc18c\uac12<\/h6>\n<p><code>SELECT MIN(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- MAX : \ucd5c\ub300\uac12<\/h6>\n<p><code>SELECT MAX(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- COUNT : \ub370\uc774\ud130 \uac1c\uc218<\/h6>\n<p><code>SELECT COUNT(\uceec\ub7fc \uc774\ub984) FROM [TABLE NAME];<\/code><\/p>\n<h6>- ROUND(\uceec\ub7fc\uba85, \uc22b\uc790) : \uceec\ub7fc\uc744 \uc22b\uc790\ub9cc\ud07c\ub9cc \ubcfc \uc218 \uc788\ub3c4\ub85d \uc18c\uc218\uc810\uc744 \ubc18\uc62c\ub9bc\ud574\uc90c<\/h6>\n<p><code>SELECT ROUND(\uceec\ub7fc \uc774\ub984, 2) FROM [TABLE NAME];<\/code><br \/>\n-> \uc18c\uc218\uc810 3\ubc88\uc9f8 \uc790\ub9ac\uc5d0\uc11c \ubc18\uc62c\ub9bc\ud574\uc11c \uc18c\uc218\uc810 \ub458\uc9f8 \uc790\ub9ac\uae4c\uc9c0\ub9cc \ubcf4\uc5ec\uc90c<br \/>\n\u00a0<\/p>\n<h5>B ) 2\uac1c \uc774\uc0c1\uc758 \uceec\ub7fc\uc744 \ud569\uccd0\uc11c \uc870\ud68c\ud558\uae30<\/h5>\n<h6>- || ' ' || \uc0ac\uc6a9<\/h6>\n<p><code>SELECT [COLUMN1] || ' ' || [COLUMN2] FROM [TABLE NAME];<\/code><\/p>\n<p><code>SELECT [COLUMN1] || ' ' || [COLUMN2] AS COLUMN12 FROM [TABLE NAME];<\/code><br \/>\n\u00a0<\/p>\n<h5>C ) \uc911\ubcf5 \uc81c\uac70 \uc870\ud68c<\/h5>\n<h6>- DISTINCT \uc0ac\uc6a9<\/h6>\n<p><code>SELECT DISTINCT(COLUMN1) FROM [TABLE NAME];<\/code><br \/>\n\u00a0<\/p>\n<h4>\u3137 ) JOIN<\/h4>\n<h5>A ) \uae30\ubcf8<\/h5>\n<p>\u00a0<\/p>\n<h5>B ) \uae30\ubcf8<\/h5>\n<p>\u00a0<\/p>\n<h4>\u3139 ) \uc751\uc6a9<\/h4>\n<h5>A ) UNION<\/h5>\n<h6>- \ucffc\ub9ac\uc758 \uacb0\uacfc\ub97c \ud569\uccd0\uc8fc\ub294 \ud568\uc218<\/h6>\n<h6>- \uc720\uc758\ud560\uc810 : \uceec\ub7fc\uba85\uc774 \uac19\uc544\uc57c\ud568 \ub2e4\ub974\ub2e4\uba74 AS\ub85c \ubcc4\uce6d\uc744 \uac19\uac8c \ub9cc\ub4e4\uc5b4 \uc8fc\uae30<\/h6>\n<h6>- UNION\uc740 \uc911\ubcf5 \uc81c\uac70, UNION ALL\uc740 \uc911\ubcf5 \ud3ec\ud568<\/h6>\n<p>\u00a0<\/p>\n<h5>B ) COALESCE(\uceec\ub7fc1, \uceec\ub7fc2, ..., \uceec\ub7fcn)<\/h5>\n<h6>- \uceec\ub7fc1\uc774 NULL\uac12\uc774 \uc544\ub2c8\uba74 \uceec\ub7fc1\uc744 RETURN<\/h6>\n<h6>- \uceec\ub7fc1\uc774 NULL\uc774\uba74 \uceec\ub7fc2\uac12\uc744 \ud655\uc778\ud558\uc5ec \uceec\ub7fc2\uac00 NULL\uc774 \uc544\ub2c8\uba74 \uceec\ub7fc2 RETURN<\/h6>\n<h6>- \uceec\ub7fc2\uac00 NULL\uc774\ub77c\uba74 \uceec\ub7fcn-1\uae4c\uc9c0 \ud655\uc778\ud6c4 \uceec\ub7fc n-1\uae4c\uc9c0 NULL\uc774\ub77c\uba74 \uceec\ub7fcn RETURN<\/h6>\n<p>\u00a0<\/p>\n<h3>2) INSERT : \ub370\uc774\ud130 \uc0bd\uc785<\/h3>\n<p>\u00a0<\/p>\n<h3>3) UPDATE : \ub370\uc774\ud130 \uc218\uc815<\/h3>\n<p>\u00a0<\/p>\n<h3>4) DELETE : \ub370\uc774\ud130 \uc0ad\uc81c<\/h3>\n<p>\u00a0<\/p>\n<h2>3. \ub370\uc774\ud130 \uc81c\uc5b4\uc5b4 (DCL : Data Control Language)<\/h2>\n<h6>- \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc811\uadfc\ud558\uac70\ub098 \uac1d\uccb4\uc5d0 \uad8c\ud55c\uc744 \uc8fc\ub294 \ub4f1\uc758 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4<\/h6>\n<p>\u00a0<\/p>\n<h3>1) GRANT : \ud2b9\uc815 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ud2b9\uc815 \uc791\uc5c5\uc5d0 \ub300\ud55c \uc218\ud589 \uad8c\ud55c\uc744 \ubd80\uc5ec<\/h3>\n<p>\u00a0<\/p>\n<h3>2) REVOKE : \ud2b9\uc815 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ud2b9\uc815 \uc791\uc5c5\uc5d0 \ub300\ud55c \uc218\ud589 \uad8c\ud55c\uc744 \ubc15\ud0c8, \ud68c\uc218<\/h3>\n<p>\u00a0<\/p>\n<h3>3) COMMIT : \ud2b8\ub79c\uc7ad\uc158\uc758 \uc791\uc5c5 \uacb0\uacfc\ub97c \ubc18\uc601<\/h3>\n<p>\u00a0<\/p>\n<h3>4) ROLLBACK : \ud2b8\ub79c\uc7ad\uc158\uc758 \uc791\uc5c5\uc744 \ucde8\uc18c \ubc0f \uc6d0\ub798\ub300\ub85c \ubcf5\uad6c<\/h3>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \ub370\uc774\ud130 \uc815\uc758 \uc5b8\uc5b4 (DDL : Data Definition Language) &#8211; \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc815\uc758\ud558\ub294 \uc5b8\uc5b4\uc774\uba70, \ub370\uc774\ud130\ub97c \uc0dd\uc131, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \ub4f1\uc758 \ub370\uc774\ud130\uc758 \uc804\uccb4\uc758 \uace8\uaca9\uc744 \uacb0\uc815\ud558\ub294 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4 &#8211; DDL\uc5d0\uc11c\ub294 \ub300\ubd80\ubd84 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 \ud14c\uc774\ube14 \uc774\ub984, \uceec\ub7fc \uc774\ub984\uc5d0 \ub300\ud574 \ub530\uc634\ud45c\uac00 \uc544\ub2cc \ubc31\ud2f1(`)\uc73c\ub85c \uac10\uc2f8\uc900\ub2e4. (\uc18d\uc131\uba85\uc740 \ub530\uc634\ud45c \uac00\ub2a5) \u00a0 1 ) CREATE : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc0dd\uc131 &#8211; \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0dd\uc131 `CREATE DATABASE `DATABASENAME`;` [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,52],"tags":[17,12,16],"class_list":["post-357","post","type-post","status-publish","format-standard","hentry","category-database","category-mysql","tag-database","tag-mysql","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.dozzing.kr\/?p=357\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World\" \/>\n<meta property=\"og:description\" content=\"1. \ub370\uc774\ud130 \uc815\uc758 \uc5b8\uc5b4 (DDL : Data Definition Language) - \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc815\uc758\ud558\ub294 \uc5b8\uc5b4\uc774\uba70, \ub370\uc774\ud130\ub97c \uc0dd\uc131, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \ub4f1\uc758 \ub370\uc774\ud130\uc758 \uc804\uccb4\uc758 \uace8\uaca9\uc744 \uacb0\uc815\ud558\ub294 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4 - DDL\uc5d0\uc11c\ub294 \ub300\ubd80\ubd84 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 \ud14c\uc774\ube14 \uc774\ub984, \uceec\ub7fc \uc774\ub984\uc5d0 \ub300\ud574 \ub530\uc634\ud45c\uac00 \uc544\ub2cc \ubc31\ud2f1(`)\uc73c\ub85c \uac10\uc2f8\uc900\ub2e4. (\uc18d\uc131\uba85\uc740 \ub530\uc634\ud45c \uac00\ub2a5) \u00a0 1 ) CREATE : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc0dd\uc131 - \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0dd\uc131 `CREATE DATABASE `DATABASENAME`;` [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.dozzing.kr\/?p=357\" \/>\n<meta property=\"og:site_name\" content=\"Dozzing World\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-28T05:57:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T02:53:02+00:00\" \/>\n<meta name=\"author\" content=\"Dozzing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dozzing\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=357\",\"url\":\"https:\/\/blog.dozzing.kr\/?p=357\",\"name\":\"[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World\",\"isPartOf\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#website\"},\"datePublished\":\"2022-06-28T05:57:47+00:00\",\"dateModified\":\"2025-10-24T02:53:02+00:00\",\"author\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.dozzing.kr\/?p=357#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.dozzing.kr\/?p=357\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=357#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.dozzing.kr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[MYSQL] \uc774\ub860 \uc815\ub9ac &#8211; \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.dozzing.kr\/#website\",\"url\":\"https:\/\/blog.dozzing.kr\/\",\"name\":\"Dozzing World\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.dozzing.kr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\",\"name\":\"Dozzing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"caption\":\"Dozzing\"},\"sameAs\":[\"https:\/\/blog.dozzing.kr\/\"],\"url\":\"https:\/\/blog.dozzing.kr\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.dozzing.kr\/?p=357","og_locale":"ko_KR","og_type":"article","og_title":"[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World","og_description":"1. \ub370\uc774\ud130 \uc815\uc758 \uc5b8\uc5b4 (DDL : Data Definition Language) - \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc815\uc758\ud558\ub294 \uc5b8\uc5b4\uc774\uba70, \ub370\uc774\ud130\ub97c \uc0dd\uc131, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \ub4f1\uc758 \ub370\uc774\ud130\uc758 \uc804\uccb4\uc758 \uace8\uaca9\uc744 \uacb0\uc815\ud558\ub294 \uc5ed\ud560\uc744 \ud558\ub294 \uc5b8\uc5b4 - DDL\uc5d0\uc11c\ub294 \ub300\ubd80\ubd84 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 \ud14c\uc774\ube14 \uc774\ub984, \uceec\ub7fc \uc774\ub984\uc5d0 \ub300\ud574 \ub530\uc634\ud45c\uac00 \uc544\ub2cc \ubc31\ud2f1(`)\uc73c\ub85c \uac10\uc2f8\uc900\ub2e4. (\uc18d\uc131\uba85\uc740 \ub530\uc634\ud45c \uac00\ub2a5) \u00a0 1 ) CREATE : \ub370\uc774\ud130\ubca0\uc774\uc2a4, \ud14c\uc774\ube14 \uc0dd\uc131 - \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0dd\uc131 `CREATE DATABASE `DATABASENAME`;` [&hellip;]","og_url":"https:\/\/blog.dozzing.kr\/?p=357","og_site_name":"Dozzing World","article_published_time":"2022-06-28T05:57:47+00:00","article_modified_time":"2025-10-24T02:53:02+00:00","author":"Dozzing","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"Dozzing","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"6\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.dozzing.kr\/?p=357","url":"https:\/\/blog.dozzing.kr\/?p=357","name":"[MYSQL] \uc774\ub860 \uc815\ub9ac - \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815 - Dozzing World","isPartOf":{"@id":"https:\/\/blog.dozzing.kr\/#website"},"datePublished":"2022-06-28T05:57:47+00:00","dateModified":"2025-10-24T02:53:02+00:00","author":{"@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f"},"breadcrumb":{"@id":"https:\/\/blog.dozzing.kr\/?p=357#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.dozzing.kr\/?p=357"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.dozzing.kr\/?p=357#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.dozzing.kr\/"},{"@type":"ListItem","position":2,"name":"[MYSQL] \uc774\ub860 \uc815\ub9ac &#8211; \uacc4\uc18d \ucd94\uac00\ub420 \uc608\uc815"}]},{"@type":"WebSite","@id":"https:\/\/blog.dozzing.kr\/#website","url":"https:\/\/blog.dozzing.kr\/","name":"Dozzing World","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.dozzing.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f","name":"Dozzing","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","caption":"Dozzing"},"sameAs":["https:\/\/blog.dozzing.kr\/"],"url":"https:\/\/blog.dozzing.kr\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=357"}],"version-history":[{"count":8,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/357\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/357\/revisions\/893"}],"wp:attachment":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}