본문 바로가기

프로그램 강좌

[MySQL]DB테이블 생성, 삭제 #2

 테이블 안의 내용을 확인하자

desc posts;

 

DB 내용 입력하기

insert into posts(title, content) values('title1','content1')

이런식으로 입력 된다.

idtitlecontent
1title1content1
2title2content2

 

DB 내용 확인하기

select * from posts;


특정 조건을 걸어 검색할 수 도 있다.

select * from posts where id=1; //id=1인 title, content
select title from posts where id=1;  //id=1인 title

테이블 삭제하기

drop table posts;


지운 테이블을 확인해보자

show tables;

잘 지워진걸 확인할 수 있다.




2020/01/08 - [프로그램 강좌] - [mySQL]최초실행, 종료, 비번설정 방법


728x90

'프로그램 강좌' 카테고리의 다른 글

[express]node express #1:Hello World  (0) 2020.01.06
[nvm]nvm 윈도우에 설치하기  (0) 2020.01.04
[mySQL]window10 설치하기 #3  (0) 2020.01.03
[Git]gitignore 파일 생성하기 #3  (0) 2020.01.02
[mySQL]window10 설치하기 #2  (0) 2020.01.01