Original link: http://www.cnblogs.com/rookie-c/p/6425039.html
Create a database
CREATE DATABASE name;
Show all databases
SHOW DATABASES;
Deleting a database
DROP DATABASE name;
Select Database
Use DATABASENAME;
Displays the tables that exist in the current database
SHOW TABLES;
View table Structure
DESCRIBE DATABASENAME;
Delete a data table
Drop TABLE NAME (delete content and definition, free space)
Delete TABLE NAME (delete content does not delete definition, does not free space)
Querying all the data in a table
SELECT * from DATABASENAME;
Conditional query (field number equals 10)
SELECT * from DATABASENAME WHERE number=10;
Multi-Criteria query (field number equals 10, field class equals 2)
SELECT * from DATABASENAME WHERE number=10 and class= "2";
Query result sort (descending by id)
SELECT * from DATABASENAME WHERE number=10 ORDER by ID DESC
Note: Sorting uses the order by default in ascending order, and Desc is used for descending
Linked table Query
To find out which fields in the tables you want to query are intersected, complete the query through the fields of the intersection.
Select*from Table A, table B where table a.xxx= table b.xxx
Paging Query
SELECT * FROM table limit m,n (data from article M to nth data)
MySQL basic Operation command "reprint"