MySQL Statement Review show databases; // display all databases select database (); // view the current database show tables; // display the Table Name USER db_name [;] // switch database desc tb_name; /DESCRIBE city;/EXPLAIN city; // display database column information SHOW columns FROM db_name; // display database column Information select version (); // query the current database version select curdata ();/SELECT CURRENT_DATE; // query the current date (yyyy-MM-dd) select now (); // query the current time (yyyy-MM-dd HH: mm: ss) select user (); // query the current Logon account select user () \ c // cancel executing the current statement create database mydb; // create database 'mydb' (databases in Unix-like environments are case sensitive) create table tb_name (co_name co_type ...); // create a table load data local infile '/path/pet.txt' into table pet [lines terminated by '\ r \ n']; // import data from a local file into the table select year (CURDATE (); // query the select month (CURDATE () of the current YEAR ()); // query the current month select dayofmonth (CURDATE (); // query the current day select right (CURDATE (), 5); // right usage select left (CURDATE (), 7); // left usage SELECT DATE_ADD (CURDATE (), INTERVAL n MONTH); // DATE_ADD usage, where n is an integer (negative value indicates subtraction) SELECT DATE_ADD (CURDATE (), INTERVAL n YEAR); SELECT DATE_ADD (CURDATE (), INTERVAL n DAY); select mod (12, 5);/SELECT 12% 5; // return the remainder operation SELECT * FROM tb_name WHERE co_name REGEXP 'regexp '; // Regular Expression fuzzy match query (NOT regexp, RLIKE, not rlike) show index from db_name; // view the index information SOURCE filename; // run the SQL script (source D:/mysql. SQL;) ALTER TABLE tb_name AUTO_INCREMENT = n; // modify auto-increment from n SELECT CONCAT (str ...); // concatenate the string (any number) show engines; // view the database engine alter table tb_name MODIFY co_name data_type; // MODIFY the Data Type of the TABLE field analyze table tb_name; // helps optimize the index