Summary of SQL statement classification

Source: Internet
Author: User

Data Definition Language DDL

Create DATABASE db_name;

CREATE TABLE table_name (column_name data_type,...);

CREATE VIEW view_name as SELECT ...;

CREATE INDEX on table_name (column_name,...);

Drop database db_name;

DROP TABLE table_name;

Drop View view_name;

Drop index table_name.index_name; (Different SQL dialect, this is the SQL Server notation)

ALTER TABLE TABLE_NAME

Add column_name data_type

Drop column_name;

Change column_name new_column_name data_type,...

Modify COLUMN_NAME data_type,...

Data Manipulation Language DML

Select column_name from table_name where ...

UPDATE table_name set Column_name=value where ...

INSERT INTO table_name (cloumn_name,...) VALUES (value1,...)

Delete from table_name where ...

Data Control Language DCL: Control permissions

Grant Select,updat,insert,delete on table_name to [email protected]_name;

Revoke SELECT,UPDAT,INSERT,DELETE on table_name to [email protected]_name;

Transaction Control Language TCL: Control transaction

Commit

Rollback


Summary of SQL statement classification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.