๐ก์ค๋ ํ ๊ฒ
mysql
show databases;
use [DATABASE ์ด๋ฆ];
select * from [TABLE ์ด๋ฆ]; //ํด๋น ํ
์ด๋ธ ์กฐํ
=> Empty set(๋น์ด์์)
show create table post;
insert into [TABLE ์ด๋ฆ] ([์ปฌ๋ผ๋ช
1], [์ปฌ๋ผ๋ช
2], [์ปฌ๋ผ๋ช
3]...) values([์ปฌ๋ผ1๊ฐ], [์ปฌ๋ผ2๊ฐ], ์ปฌ๋ผ3๊ฐ]...);
select * from [TABLE ์ด๋ฆ];
sselect * from [TABLE ์ด๋ฆ] \G;
select * from [TABLE ์ด๋ฆ] where writer = 'a"??
update [TABLE ์ด๋ฆ] set [์ปฌ๋ผ๋ช
] = [๋ฐ๊ฟ ์ปฌ๋ผ๊ฐ] where id = [id ๋๋ฒ];
//ํด๋น id์ ํด๋น ์ปฌ๋ผ๋ช
์ ๊ฐ์ ๋ฐ๊ฟ
ex)
update post set read_count = read_count + 1 where id = 5;
delete from [TABLE ์ด๋ฆ] where id = [id ๋๋ฒ];
//ํด๋น ํ
์ด๋ธ์ ๋ช๋ฒ์งธ id๋ฅผ ์ง์ด๋ค