Get the App
SLTechnology News&Howtos  ›  Database  › 

Classification and summary of sql statements

Shulou Source: shulou.com Published: 2022-06-01 09:45:19 10月06日 Update

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 dialects are different, this is the way sql server is written)

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 'user_name'@'host_name'

Revoke select,updat,insert,delete on table_name to 'user_name'@'host_name'

Transaction control language TCL: controlling transactions

Commit

Rollback

Tags: Language control data different transaction writing dialect permission this is statement classification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL macOS Apple vpn