Table of contents
You’ve all seen this, give it a thumbs up and go away, thank you, thank you! ! !
1. Database operations
Note: MySQL is not case-sensitive, so when we enter the code, we can enter it in uppercase or lowercase.
(1), display database
语法:SHOW DATABASES;
Code display:
(2) Create database
Syntax:CREATE DATABASE [IF NOT EXISTS] Database name;
Code display:
(3) Delete the database
语法:DROP DATABASE [IF EXISTS] 数据库名
([IF EXISTS] is optional. If the database name exists, it will be deleted. If not, it will not be deleted, and the program will not report an error. )
Code display:
(4), use database
Language:USE Numerical name
Code display:
2. Common data types
(1), numerical type
Numeric types can also be specifiedunsigned types (unsigned), means not taking negative numbers.
(2), string type
(3), date type
3. Table operations
(1), create table
Syntax:CREATE TABLE table name (column name type, column name type...);
Code display:
(2), view table
Language:DESC table name
Code display:
(3) Delete table
语法:DROP TABLE [IF EXISTS] 表名
([IF EXISTS] is optional. If the table name exists, it will be deleted. If not, it will not be deleted, and the program will not report an error. )
Code display: