这是我参与8月更文挑战的第11天,活动详情查看:8月更文挑战
SQL(Structure Query Language)语言是数据库的核心语言。
SQL 语言分类
SQL 语言共分为四大类:数据操纵语言 DML,数据定义语言 DDL,数据控制语言 DCL,事物控制语言 TCL。
DML
DML(Data Manipulation Language)数据操纵语言,用于操作数据库理的数据。
SELECT- retrieve data from the a database 查询INSERT- insert data into a table添加UPDATE- updates existing data within a table 更新DELETE- deletes all records from a table, the space for the records remain 删除CALL- call a PL/SQL or Java subprogramEXPLAIN PLAN- explain access path to dataLOCK TABLE- control concurrency 锁,用于控制并发
DDL
DDL(Data Definition Language)数据定义语言,用于定义和管理数据库中的所有对象的语言。
CREATE- to create objects in the database 创建ALTER- alters the structure of the database 修改DROP- delete objects from the database 删除TRUNCATE- remove all records from a table, including all spaces allocated for the records are removedCOMMENT- add comments to the data dictionary 注释
DCL
DCL(Data Control Language)数据控制语言,是用来设置或更改数据库用户或角色权限的语句。
GRANT- gives user's access privileges to database 授权REVOKE- withdraw access privileges given with the GRANT command 收回已经授予的权限
TCL
TCL(Transaction Control Language)事物控制语言。
COMMIT- save work done 提交SAVEPOINT- identify a point in a transaction to which you can later roll back 保存点ROLLBACK- restore database to original since the last COMMIT 回滚SET TRANSACTION- change transaction options like what rollback segment to use 设置当前事务的特性,它对后面的事务没有影响