1. Query Data
Statement format: select * from table name;
Example:
select * from member;
Query the specified column statement format: select column 1, column 2,... from table name;
Example:
select id,name from member;
2. Add Data
Statement format of adding data to the whole column: insert into table name values (...);
Example:
Insert into member values (0, 'Zhang San', 25, 'male');
Some columns add data statement format: insert into table name (column 1,...) values (value 1,...);
Example:
Insert into member (name, age) values ('Zhang San ', 26);
Full column multi row insertion syntax: insert into table name values (value 1,...), (value 1,...);
Example:
Insert into member values (0, 'Zhang San', 26, 'male'), (1, 'Li Si', 26, 'female'), (2, 'Zhang San', 24, 'male');
Syntax for multi row insertion of partial columns: insert into table name (column 1,...) values (value 1,...), (value 1,...);
Example:
Insert into member (name, age) values ('Wang Wu ', 22), ('Zhao Liu', 21);
3. Modify Data
语法格式:update 表名 set 列1=值1,列2=值2,… where 条件;
Example:
update member set age=18,gender=’女’ where id=4;
4. Delete Data
Syntax format: delete from table name where condition;
Example:
delete from member where id=2;