This lesson first experiences the basic syntax of MySQL. Action folder (library) increase
Create Database db1 charset UTF8;
Check
# View the currently created database Show Create database db1; # View all databases show databases;
Change
ALTER DATABASE DB1 CharSet GBK;
By deleting
Drop database db1;
Action file (table)
# Toggle Folder # View your current folder
Increase
CREATE TABLE T1 (id int,name char);
Check
# View the current T1 table Show CREATE table T1; # View all the tables show tables; # View the details of a table desc t1;
Change
# Modify modified meaning ALTER TABLE t1 modify name char (6); # change the name to uppercasename ALTER TABLE t1 changes name NAMA char (7);
By deleting
# Delete Tables drop table t1;
Operation file contents (record) increased
# Insert a piece of data that specifies id,name data leileiInsert T1 (id,name) VALUES (1,"mjj01"), (2," mjj02 "), (3,"mjj03");
Check
From fromfrom Db1.t1;
Change
Update db1.t1 set name='zhangsan'; update db1.t1 set name='Alex ' where id=2;
By deleting
from from where id=2;
04-Initial MySQL statement