Use + database name: using this database
Creating a data table unsgined means unsigned bit
[IF not EXISTS] can be omitted
CREATE table [IF not EXISTS] table (
Usename VARCHAR (20),
Age TINYINT unsgined
)
Show TABLES: See how many tables there are in the database
Show TABLES from MySQL: View tables for all databases
SELECT database (): Displays the current database
Show COLUMNS from SS: View the structure type of the database
Inserting data into a table
INSERT SS (Name,age) VALUES (' Li Haiyang ', 20)
Auto_increment: Auto-numbered and must be combined with primary key
By default, its starting value is 1, with increments of 1 per
Specifies that the text column be placed first
ALTER TABLE AA Modify text VARCHAR (255) First
Put the text behind age
ALTER TABLE AA Modify text VARCHAR (255) after age
Where: It is followed by the condition of the query.
As N uses aliases.
Delete data from Name= Li Haiyang in the SS table
DELETE from SS WHERE name= ' Li Haiyang '
Delete ID this column
ALTER TABLE SS DROP COLUMN ID;
Add an ID to this column
ALTER TABLE SS add column ID INT PRIMARY KEY auto_increment
Some basic syntax for MySQL