Home  >  Article  >  Database  >  Mysql basic statements - add, delete, modify and query

Mysql basic statements - add, delete, modify and query

零下一度
零下一度Original
2017-05-02 09:42:311576browse

This article mainly introduces the relevant information about the simple implementation of Mysql's add, delete, modify and query statements. Friends in need can refer to

The simple implementation of Mysql's add, delete, modify and query statements

Add record:


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

Delete record:


delete from tablename where condition ;

Modify records:


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

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

Query records:


select (...) from tablename where condition ;

select * from tablename where condition ;

Delete the entire table:


##

drop table tablename ;

Add a column:


alter table tablename add column columnname columntype ... ;

Delete column:


alter table tablename drop column columnname ;

The above is the detailed content of Mysql basic statements - add, delete, modify and query. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn