
table ๋ฌธ๋ฒ
table ์์ฑ
create table tablename (
columnname datatype,
columnname datatype,
...
);
table ๋ชฉ๋กํ์ธ
show tables;
table ์ ๋ณดํ์ธ
desc tablename;
table name ๋ณ๊ฒฝ
alter table tablename
rename new_tablename;
table column ์ถ๊ฐ
alter table tablename
add column columnname datatype;
table column ๋ณ๊ฒฝ
alter table tablename
modify column columnname datatype; //datatype
alter table tablename
change column old_columnname new_columnname new_datatype; //name
table column ์ญ์
alter table tablename
drop column columnname;
table ์ญ์
drop table tablename;
create table example
(
id int,
name varchar(16)
);
alter table example
add column age int;
alter table example
add column old int;
alter table example
drop column age;
alter table example
change column old sex char;
drop table animal;
๐ซ table ์์ฑ ์ ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ค์ ํ๊ธฐ
์ค์ตํ์ธ
![]() | ![]() |
|---|