simple commands that are commonly used by MySQL :
1. Display the current server version: SELECT version ();
2. Display the current date: SELECT now ();
3. Display the current User: SELECT user ();
syntax specification for MySQL statements :
1. keyword and function name all uppercase
2. Database name, table name, field name all lowercase.
The 3.SQL statement must end with a semicolon.
If we do not enter ";", then the system is no more than the end, as long as we enter ";" the statement ends .
————————————————————————————————————————————————————————————
To Create a database :
CREATE {DATABASE | Schema} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] Charset_name (DATABASES and SCHEMA are the same).
————————————————————————————————————————————————————————————
to view a list of data tables under the current server :
SHOW {DATABASES | SCHEMAS}
[like ' Pattern ' | WHERE Expr]
——————————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————————————
To Modify a database :
ALTER {DATABASE | SCHEMA} [Db_name] [DEFAULT] CHARACTER SET [=] Charset_name
——————————————————————————————————————————————————
To Delete a database :
DROP {DATABASE | SCHEMA} [IF EXISTS] Db_name
Root@127. 0.0. 1 Test>DROPDATABASE0 rows affected (0.05 sec)
——————————————————————————————————————————————
MySQL's prompt