zoukankan      html  css  js  c++  java
  • What are the difference between DDL, DML and DCL commands[转]

    What are the difference between DDL, DML and DCL commands?

    Submitted by admin on Wed, 2004-08-04 13:49

    DDL

    Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
    • 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 removed
    • COMMENT - add comments to the data dictionary
    • RENAME - rename an object
    DML

    Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
    • 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
    • MERGE - UPSERT operation (insert or update)
    • CALL - call a PL/SQL or Java subprogram
    • EXPLAIN PLAN - explain access path to data
    • LOCK TABLE - control concurrency
    DCL

    Data Control Language (DCL) statements. Some examples:
    • GRANT - gives user's access privileges to database
    • REVOKE - withdraw access privileges given with the GRANT command
    TCL

    Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
    • 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 isolation level and what rollback segment to use

    http://www.orafaq.com/faq/what_are_the_difference_between_ddl_dml_and_dcl_commands

    A data dictionary is a collection of descriptions of the data objects or items in a data model for the benefit of programmers and others who need to refer to them. A first step in analyzing a system of objects with which users interact is to identify each object and its relationship to other objects. This process is called data modeling and results in a picture of object relationships. After each data object or item is given a descriptive name, its relationship is described (or it becomes part of some structure that implicitly describes relationship), the type of data (such as text or image or binary value) is described, possible predefined values are listed, and a brief textual description is provided. This collection can be organized for reference into a book called a data dictionary.

    When developing programs that use the data model, a data dictionary can be consulted to understand where a data item fits in the structure, what values it may contain, and basically what the data item means in real-world terms. For example, a bank or group of banks could model the data objects involved in consumer banking. They could then provide a data dictionary for a bank's programmers. The data dictionary would describe each of the data items in its data model for consumer banking (for example, "Account holder" and ""Available credit").

  • 相关阅读:
    Ubuntu vsftp复制文件到远端时错误,Permission denied
    linux 常用命令
    vbox安装ubuntu之后挂载共享文件夹无权限访问的问题以及改了主机名,导致命令行不能解析主机名的问题
    java 中的valueOf方法和强转
    读写文件,用代码在讲html文件转为jsp文件
    hibernate查询之后用el表达式取值时遇到的问题
    考研:操作系统:进程同步—信号量实现同步互斥(PV操作)
    考研:操作系统:处理机调度——几种经典的调度算法
    KMP算法
    mysql出现ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' 错误
  • 原文地址:https://www.cnblogs.com/flyinthesky/p/1573149.html
Copyright © 2011-2022 走看看