Basic statement about MySQL
Ps:[] is the default
Created: Create DATABASE db.name
CREATE table name (column name, type, [NULL]) NOT NULL is not required to be empty, not NULL needs to be defined when TABLE is created
Select database: Use Db.name
Show current database: SELECT database ()
Show now exists: Show DATABASES
SHOW TABLES [from Db.name]
Show table data structure: show COLUMNS from Tb.name
Insert record (data): Insert[into] tb.name [(Col.name,...)] VALUES (Val,...)
PRIMARY KEY constraint PRIMARY key has uniqueness, each table can have only one primary key, not NULL
Uniqueness of unique constraint exists, there can be more than one unique in a table, can be NULL, but null in a table can only have one
Default constraint defaults is set default value
Auto-encode (applies int, but can use floating-point number, but not decimal) auto_increment can only be bound on primary key (when the primary key is similar ID, it is convenient to use automatic encoding)
Show Table records: SELECT * from Table.name
MySQL's learning essay Day1