Commonly used sql statements

Common sql statements:

Delete data in a table:
delete from table name;
delete from table name where field value='';

Add a piece of data:
insert into table name (field 1, field 2, field 3) values ​​(value 1, value 2, value 3)

Query all data in the table:
select * from table name

Query the data in the table that meets the conditions:
select * from table name where field value = '';

Modify the value of a field in the table:
update table name set field='value' where condition;

Add a column to the created table
alter table table name add column column name varchar(20) not null;

Delete a column in the created table
alter table table name drop column column name;

Modify the size of the fields in the
table alter table table name modify(field value varchar(4000));

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325847536&siteId=291194637