Display database:show databases;
Use database (Connect database to switch database):use+ database name;
Show a table in a database:show tables;
Creating database: Createdatabase+ database name;
To create a table:
CREATE TABLE Student (
ID int (4) primary key auto_increment,
Name varchar (one) not NULL comment " name ",
Number varchar (one) not NULL comment " Study no. "
);
(Manipulate table content data)
Query all data in a table:select * from table name;
Select Name,number from table name;
Insert a piece of data into a table:insert into table name VALUES ( attribute values );
INSERT into table name (name,number) VALUES (' SDF ', ' sdfgh ');
Delete a record in a table:delete from table name where property = a value ;
Modify a record in a table:update table name set property = A value where Properties = a certain value;
(Manipulate table properties)
Show Table Structure Properties : desc+ table name;
Add a property to a table:alter table name Add property name data type, etc.;
Delete a property of a table:alter table name drop property name;
Modifies a property of a table:alter table name Changes the property name data type after the original property name is modified;
Data type : range based on experience
Datatime type is a time format
tinyint (4); represents a number;
Modify the name of the database table:rename table name to the present form name;
See if the changes were successful: show tables;
Delete database table:drop table name;
Delete the database:drop database name;
MySQL Basic operation