Recall the SQL statements that I encountered yesterday, and briefly talk about common SQL statements ~
</PRE> <p> insert </P> <p> </P> <PRE name = "code" class = "SQL"> insert into table name [(field name 1, field name 2 ,... Field name n)] values ('value 1', 'value 2 ',..., 'Value n ');
Delete
Delete from table name [Where condition] [order by field] [limit row number}
Select
Select [All | distinct] {* | table. * | [Table.] field1 [as alias1] [, [Table.] field2 [as alias2] [,…]} From table name [where clause] [group by...] [having...] [order by...] [limit count];
Select a specific field:
Retrieve all table data
<pre name="code" class="sql">SELECT username,password FROM user;
SELECT * FROM table;
Use where for conditional search: Between and perform range comparison query in for range comparison query // In () like fuzzy query order by sort query results limit number of results rows use statistical function
Select function name (column name 1 or *),... function name (column name N) from table name; # Use The statistical function count () to record the total number of rows
SQL statements for beginners