Home > Database > Mysql Tutorial > body text

Mysql basic statements - add, delete, modify and query

零下一度
Release: 2017-05-02 09:42:31
Original
1621 people have browsed it

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(...)
Copy after login

Delete record:


delete from tablename where condition ;
Copy after login

Modify records:


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

alter table tablename set xx=xx , xx=xx... where condition ;
Copy after login

Query records:


select (...) from tablename where condition ;

select * from tablename where condition ;
Copy after login

Delete the entire table:


##

drop table tablename ;
Copy after login

Add a column:


alter table tablename add column columnname columntype ... ;
Copy after login

Delete column:


alter table tablename drop column columnname ;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template