Comparison of DDL, DML, and DCL "reference learning"

Source: Internet
Author: User

1. DDL

1-1. Overview of DDLDDL (data definition Language)A property that is used to manipulate objects and objects, including the database itself, and database objects, such as tables, views, and so on, where the DDL manages and defines these objects and properties on the Create, drop, and alter. Special note: The concept of "object" for DDL operations, "Objects" includes the properties of objects and objects, and the smallest objects are more hierarchical than records. For example: Create creates a data table, alter can change the field of the table, drop can delete the table, from here we can see the height of the DDL station, he will not operate on the specific data.       1-2, DDL main statement (action)                create statement: You can create some objects for databases and databases.                DROP statements: You can delete data tables, indexes, triggers, constraints, and permissions for data tables.                alter statements: Modify data table definitions and properties.       1-3, DDL Operations Objects (table)                1-3-1, table concept                             The creation of the table is used to store the data, because we store the different data, so we need to define some data types, to facilitate management.                1-3-2, table properties                 & nbsp           PRIMARY key attributes: The primary key is the PRIMARY KEY constraint, but the name of the primary key is different from the virtual (that is, the description of the event), the PRIMARY KEY constraint name is biased to real (that is, describing the implementation of the operation), the description is the same thing, A PRIMARY KEY constraint is a property in a table, and in a tableThere can be a maximum of one primary key; A primary key can be defined in one or more fields; The primary key causes one or more fields to be unique and not NULL, so that a record can be represented by the field or by the value in that group field.                             unique attribute: Only one primary key attribute can be in a table, in order for the party table user , a unique constraint is proposed; a unique constraint can be defined on one or more fields, and a unique constraint makes the field or value in that Group field unique and nullable, but cannot be duplicated.                             FOREIGN key properties: Also called foreign key, also called FOREIGN KEY constraint, with primary KEY and PRIMARY KEY constraint The relationship is the same as the foreign KEY constraint for the two tables, if Table A's primary key is a field in table B, then the field is called Table B's foreign key, table A is called the primary table, table B is called from the table, but be aware that you must know that you are in this relationship.                  review, NULL and default properties: The verification attribute is also called the verification constraint, the null attribute is also called the null constraint, and the default property is called the default constraint These names describe one thing, describe a situation where we can of course do this deliberately (input data is the attention line), but they are meant to be automated, that is, let the computer do it.             (Do you know why indexes are automatically created when you create a primary key and a unique constraint?) and is the only index, think of the index is mostly used in those fields, as well as the role of the index will know. Such operations as primary KEY constraints, unique constraints, non-null constraints, FOREIGN KEY constraints, verification constraints, and default constraints are all attributes of the table, so here I think they are all properties of the table. ) RELATED Links: Understanding of DDL, DML, and DCL (1-1, DDL: Data definition)  2, dml      2-1, DML overview             & nbsp  DML (Data manipulation Language-control language)Used to manipulate the data contained in a database object, that is, the unit of operation is a record.               2-2. DML's main statement (ACTION) INSERT statement: Inserts a record into the data sheet.               Delete statement: Deletes one or more records from a data table, or deletes all records in the datasheet, but its operands are still records.      UPDATE statement: Used to modify the contents of a record in an existing table. 2-3, DML Operation Object--record 2-3-1, note when we insert, delete and update the record, we must pay attention to, must be aware of some of the DDL operation. RELATED Links: Understanding of DDL, DML, and DCL (1-2, DML: Data manipulation) 3, DCL 3-1, DCL overviewDCL (Data Control Language statement)Operations are permissions on database objects, and the determination of these operations makes the data more secure.                3-2. Main statement of DCL (operation) GRANT statement: Allows the creator of an object to give certain permissions to a user or to a group or all users (public). Revoke statement: Can revoke a user or a group or all user access rights 3-3, DCL Action Object (user) at this time the user refers to the database user. Later articles will be described in detail.

http://blog.csdn.net/jiben2qingshan/article/details/7832344

Comparison of DDL, DML, and DCL "reference learning"

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.