Understanding of DDL, DML, and DCL

Source: Internet
Author: User
Tags table definition

First, DDL

1. DDL Overview DDL (data definition Language) is used to manipulate the properties of objects and objects, including the database itself, as well as database objects, such as tables, views, and so on, The management and definition of these objects and properties by DDL is specific to 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.2. DDL main Statement (operation)Create statement: Some objects of the database and database can be created.      Drop statement: You can delete data tables, indexes, triggers, conditional constraints, and permissions for data tables. Alter statement: Modifies the data table definition and properties.3. DDL Operations Objects (table)1), table of the concept of the creation of the table is used to store data, due to the different data we store, so we need to define some data types to facilitate management. 2), table's property primary key property: 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, describe the implementation of the operation), describing the same thing, the PRIMARY KEY constraint is a property in the table, in a table can be            There is a primary key; A primary key can be defined in one or more fields; A 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 is allowed in a table, and a unique constraint is proposed for the user of the party table; a unique constraint can be defined on one or more fields; a unique constraint makes the field or the value in that Group field unique and nullable, but cannot be duplicated. Foreign key attribute: Also called foreign key, also called FOREIGN KEY constraint, the relationship between the primary key and the PRIMARY KEY constraint is the same, the foreign KEY constraint is for the two tables, and 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 be aware of this relationship.
verification, 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 attribute is also called the default constraint; These names describe one thing, describe a situation, this thing or this case we can certainly do it deliberately (input data is the attention on the line), but, Their intention was to automate, that is, to have the computer do it. Overview of DML1, DML, DML (data manipulation Language) is used to manipulate the data contained in database objects, that is, the units of operations are records.     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. 3, DML Operation Object-record 1), notewhen we insert, delete, and update records, it's important to note that some of the DDL's operations are clear. Overview of DCL1, DCL the action of the DCL (Data Control Language) is the permission of the database object, and the determination of these operations makes the data more secure.     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, DCL Action object (user) at this time the user refers to the database user.

Understanding of DDL, DML, and DCL

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.