Types of SQL Statements Supported by MySQL
SELECTING, CREATING, DROPPING, AND ALTERING DATABASES
USE
CREATE DATABASE
DROP DATABASE
ALTER DATABASE
CREATING, ALTERING, AND DROPPING TABLES AND INDEXES
CREATE TABLE
DROP TABLE
CREATE INDEX
DROP INDEX
ALTER TABLE
GETTING INFORMATION ABOUT DATABASES AND TABLES
DESCRIBE
SHOW
RETRIEVING INFORMATION FROM TABLES
SELECT
UNION
PERFORMING TRANSACTIONS
SET AUTOCOMMIT
START TRANSACTION
COMMIT
ROLLBACK
MODIFYING INFORMATION IN TABLES
DELETE
INSERT
LOAD DATA
REPLACE
UPDATE
ADMINISTRATIVE STATEMENTS
FLUSH
GRANT
REVOKE

Creating Databases
To create a database, use a CREATE DATABASE statement:
CREATE DATABASE db_name;Comment by str — May 25, 2005 @ 1:36 pm
In addition:
CREATE DATABASE supports several optional clauses.
CREATE DATABASE [IF NOT EXISTS] db_name[CHARACTER SET charset] [COLLATE collation];
Comment by str — May 25, 2005 @ 1:40 pm
Dropping Databases
DROP DATABASE db_name;Comment by str — May 25, 2005 @ 1:41 pm
Altering Databases
The ALTER DATABASE statement makes changes to a database’s global attributes. Currently, the only such attributes are the default character set and collation:
ALTER DATABASE db_name [CHARACTER SET charset] [COLLATE collation];
Comment by str — May 25, 2005 @ 1:43 pm
Checking Which Storage Engines Are Available
To see a list of available storage engines, use the SHOW ENGINES statement:
mysql> SHOW ENGINES;Comment by str — May 25, 2005 @ 2:02 pm
Temporary Tables
You can use CREATE TEMPORARY TABLE to create temporary tables that disappear automatically when your connection to the server terminates. This is handy because you don’t have to bother issuing a DROP TABLE statement to get rid of the table, and the table doesn’t hang around if your connection terminates abnormally.
CREATE TEMPORARY TABLE new_tbl_name LIKE tbl_name;Comment by str — May 25, 2005 @ 2:12 pm
Creating Tables from Other Tables or Query Results
MySQL provides two statements for creating new tables from other tables or from query results. These statements have differing advantages and disadvantages:
Comment by str — May 25, 2005 @ 2:15 pm
Dropping Tables
DROP TABLE tbl_name;Comment by str — May 25, 2005 @ 2:18 pm