CREATE TABLE Table name
(
Whether the column name data type is empty (whether the primary key | is a unique | foreign key relationship),
Column name data type ... (The last column does not have a comma)
)
Create DATABASE name
Insert into database name. Table name values (data, comma separated by column order)
Update table Set column = new value where condition
Delete from table where condition
Select results show column from table where condition
Sum avg Max min count (number of) Order ASC DESC
CREATE TABLE Test1
(
UID varchar (primary) key (primary key),
PWD varchar (50),
Name varchar (50),
Netion varchar (50),
Foreign KEY (netion) references netion (code)
)
Attention:
1. Create a table after the last column do not write a comma
2. If more than one statement is executed together, be aware that semicolons are separated between statements
3. Write the code, all the symbols are half-width
Create several keywords for the table:
Primary key: Primary key
Non-empty: NOT NULL
Mysql:
Self-growing column: Auto_increment (must be cosmetic)
Foreign key relationship: FOREIGN key (column name) references table name (column name)
CRUD Operations:
Added: INSERT into info values (', ', ', ' ', ', ') require the value in the parentheses to be the same as the number of columns in the table
Insert into info (code,name) VALUES (",") adds the value of the specified column
Modified: Update info set name= ' Zhang San ' where code= ' p001 '
Delete: Delete from info where code= ' p001 '
MYSQL: Delete and change