MySQL Command Types


MySQL Commands are divided into three different categories as per their functionality.

(1) Database Definition Language (DDL):

DDL contains commands that are used to define database or tables, define or alter structure of table, define relationship among various tables in the database, drop database or tables.
Following are the list of MYSQL commands that comes under this category:

Command Purpose
CREATE DATABASE This command allows you to create new database.
USE This command allows you to select database.
DROP DATABASE This command allows you to delete database.
CREATE TABLE This command allows you to create new table in the selected Database.
ALTER TABLE This command allows you to modify the structure of the table.
DROP TABLE This command allows you to delete table from the database.
SHOW DATABASES This command allows you to display list of databases available in the server.
SHOW TABLES This command allows you to display list of tables available in the selected Database.
     

(2) Database Manipulation Language (DML):

DML contains commands that are used to retrieve records from the table, insert new record into table, update records into table, and delete record from the table.
Following are the list of MYSQL commands that comes under this category:

Statement Purpose
SELECT
This command allows you to retrieve records from the table. You can specify various conditions with this command to retrieve specific records.
INSERT
This command allows you to insert new record into table.
UPDATE
This command allows you to update existing record. You can also specify condition with this command.
DELETE
This command allows you to delete records from the table. You can also specify condition with this command.

(3) Database Control language (DCL):

DCL contains commands that are used to define the various types of privileges on Database or tables.
Following are the list of MYSQL commands that comes under this category:

Statement Purpose
GRANT This command allows you to set or reset access privileges o the user for specific operations.
REVOKE

Download Projects


Download Programs