Learn DML, DDL, DCL

A, DML

DML (Data Manipulation Language) data manipulation language:

The most frequently used SELECT, UPDATE, INSERT, DELETE. Mainly used for some operation on the data in the database

SELECT column names the FROM TableName
 the UPDATE TableName the SET column name = value the WHERE column name = a value of
 the INSERT  the INTO table_name (column 1, column 2, ...) the VALUES (VALUE1, value2, ....)
 the DELETE  the FROM TableName the WHERE column name = value

Two, DDL

DDL (Data Definition Language) database definition language:

DDL is mainly used in the definition or changing the structure of the table, the data type, the link between the tables and constraints initialization work, when creating a table used in a number, such as: CREATE, ALTER, DROP and the like.

The CREATE  TABLE TableName 
( 
Column Name Data Type 1, 
column 2 the data type name, 
column name data type 3, 
.... 
) 

the ALTER  TABLE TableName
 the ALTER  the COLUMN column_name DataType 

the DROP  TABLE TableName
 the DROP  DATABASE database name

Three, DCL

DCL (Data Control Language) database control language:

Is used to set or change the database user or role privileges statements, including (grant, deny, revoke, etc.) statement

Grant SELECT,DELETE,INSERT,UPDATE on tablename to role;

 

Guess you like

Origin www.cnblogs.com/dudu485/p/11497352.html