-
SQL语言基础-数据操作语
资源介绍
数据操作语言
*
DML语句在下列情况下发生:
往一个表中增加新行
更改一个表中现有的行
从一个表中删除掉现有的行
一个事务由一组构成一个逻辑操作的DML语句组成.
*
Data Manipulation Language
Data manipulation language (DML) is a core part of SQL. When you want to add, update, or delete data in the database, you execute a DML statement. A collection of DML statements that form a logical unit of work is called a transaction.
Consider a banking database. When a bank customer transfers money from a savings account to a checking account, the transaction might consist of three separate operations: decrease the savings account, increase the checking account, and record the transaction in the transaction journal. The Oracle Server must guarantee that all three SQL statements are performed to maintain the accounts in proper balance. When something prevents one of the statements in the transaction from executing, the other statements of the transaction must be undone.
Instructor Note
DML statements can be issued directly in SQL*Plus, performed automatically by tools such as Oracle Developer or programmed with tools such as the 3GL precompilers.
Every table has INSERT, UPDATE, and DELETE privileges associated with it. These privileges are automatically granted to the creator of the table, but in general they must be explicitly granted to other users.
Starting with Oracle 7.2, you can place a subquery in the place of the table name in an UPDATE statement, essentially the same way a view is used.