>  기사  >  데이터 베이스  >  MySQL 기본 명령문 - 추가, 삭제, 수정 및 쿼리

MySQL 기본 명령문 - 추가, 삭제, 수정 및 쿼리

零下一度
零下一度원래의
2017-05-02 09:42:311576검색

이 글에서는 주로 Mysql의 add, delete, 명령문 수정 및 쿼리

기록 추가:

insert into tablename(...) values(...)
//如果增加的记录包括所有的列,则不需要写数据列表
insert into tablename values(...)


기록 삭제:

delete from tablename where condition ;


기록 수정:

update tablename set xx=xx , xx=xx... where condition ;

alter table tablename set xx=xx , xx=xx... where condition ;


기록 조회:

select (...) from tablename where condition ;

select * from tablename where condition ;


전체 테이블 삭제:

drop table tablename ;


열 추가:

alter table tablename add column columnname columntype ... ;


열 삭제:

alter table tablename drop column columnname ;

위 내용은 MySQL 기본 명령문 - 추가, 삭제, 수정 및 쿼리의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.