What Is a Data Definition Language?
Data Definition Language (DDL) is the language responsible for data structure definition and database object definition in the SQL language set. It is composed of three syntaxes: CREATE, ALTER, and DROP. It was originally composed of Codasyl (Conference on Data Systems Languages) data model Initially, it is now included as a subset of SQL instructions. At present, most DBMSs support DDL operations on database objects. Some databases (such as PostgreSQL) can place DDL in transaction instructions, that is, it can be withdrawn (Rollback). Newer versions of the DBMS include DDL-specific triggers that allow database administrators to track changes from DDL. .
- Sql statements are divided into three categories: data definition language, which is responsible for creating, modifying, deleting tables, indexes, views, functions, stored procedures, and triggers; data manipulation language, which is responsible for data insertion, modification, and deletion in the database ; Data control language for granting and revoking user permissions.
Data definition language logical structure
- Three-level logical structure of relational database supported by SQL language [1] .
- 1) The three-level logical structure of the relational database supported by SQL language consists of the outer layer, the concept layer, and the memory, as shown in the figure.
- 2) At the concept level, the concept record type corresponding to the concept model is the basic table. A basic table is a table that actually exists on its own. A basic table is a relationship, it is not a table derived from other tables. The basic table is created using the CREATE TABLE statement.
- 3) In the outer layer, the user can see the basic table, the view, or the basic table + view. A view is a virtual table. It is a table derived from one or more basic tables. It is not a table that exists directly on physical storage. Views are created using the CREATE SQL VIEW statement.
- 4) In the inner layer, each basic table is represented by a storage file, that is, a set of storage record values of the same type. DBAs can operate on physical storage files.
Data definition language main features
- 1) The SQL language is similar to the natural language of English. The language is concise and easy to learn and use. Beginners can use SQL to access data after short-term training.
- 2) SQL language is a non-procedural language. As long as the user asks "what to do", as for "how to do", it will be solved by the RDBMS to hide the data access path from the user.
- 3) The SQL language is a set-oriented language. The objects and results of operations are relations.
- 4) The SQL language can be used independently or embedded in the host language. It has two characteristics: self-contained and host-type.
- 5) SQL language has the characteristics of integration of four languages: query, operation, definition and control.