Mysql will have basic syntax at a glance, and mysql basic syntax
Create a table
Create table <table Name> (
<Field Name> type (length) not null primary key auto_increment, ** primary key
Name char (20) not null,
Sex int (4) not nullDefault'0', ** default key
Degree double (16, 2)
)
Delete table
Drop table <table Name>;
Clear table
Delete from <Table Name>;
Insert data
Insert into <Table Name> [(<field name 1> [,... <field name n>])] values (value 1) [, (value n)]
Query a table
Select <Field 1, Field 2,...> from <Table Name> where <expression>
Query the first few fields of a table
Select * from MyClass order by id limit 0, 2;
Total query Fields
Select sum ('field name') from Table Name
Query fields in ascending and descending order
In descending order: select * from table name where expression order by field name desc
Ascending order: select * from table name where Putout = true order by time asc
Delete table
Delete from table name where expression
Modify Table
Update table name set field = new value ,... Where condition
Add Table Fields
Alter table name add other field types;
<1 primary key: alter table name add primary key (field name );
<2 unique constraint: alter table name add unique index name (field name );
Delete table fields
Alter table Name drop field name