DDL Syntax Overview
Data definition language (DDL) is used to define or modify an object in a database, such as a table, index, or view.
M-compatible does not support DDL operations when the primary database node is incomplete. For example, if the primary database node in the database is faulty, creating a database or a table will fail.
Defining a Role
A role is used to manage permissions. For database security, management and operation permissions can be granted to different roles. Table 1 lists the involved SQL statements.
Defining a User
A user is used to log in to a database. Different permissions can be granted to users for managing data accesses and operations of the users. Table 2 lists the involved SQL statements.
Defining a Database or Schema
In M compatibility, database and schema are synonyms. A database or schema is the warehouse for organizing, storing, and managing data. Defining a database includes: creating a database, altering the database attributes, and dropping the database. Table 3 lists the involved SQL statements.
Defining a Table
A table is a special data structure in a database and is used to store data objects and relationship between data objects. Table 4 lists the involved SQL statements.
Defining a Partitioned Table
A partitioned table is a logical table used to improve query performance and does not store data (data is stored in ordinary tables). Table 5 lists the involved SQL statements.
|
Function |
SQL Statement |
|---|---|
|
Creating a partitioned table |
|
|
Create a partition |
|
|
Altering partitioned table attributes |
|
|
Deleting a partition |
|
|
Dropping a partitioned table |
|
|
Creating a level-2 partitioned table |
|
|
Modifying partitions in a level-2 partitioned table |
Defining an Index
An index indicates the sequence of values in one or more columns in a database table. It is a data structure that improves the speed of data access to specific information in a database table. Table 6 lists the involved SQL statements.
Defining a Plug-in Extension
This feature is for internal use only. You are advised not to use it.
|
Function |
SQL Statement |
|---|---|
|
Creating an extension |
|
|
Modifying an extension |
|
|
Deleting an extension |
Defining a User Group
|
Function |
SQL Statement |
|---|---|
|
Creating a user group |
|
|
Modifying attributes of a user group |
|
|
Deleting a user group |
Defining a Sequence
|
Function |
SQL Statement |
|---|---|
|
Adding a sequence to the current database |
|
|
Modifying parameters of an existing sequence |
|
|
Deleting a sequence from the current database |
Defining a View
|
Function |
SQL Statement |
|---|---|
|
Creating a view |
|
|
Modifying the auxiliary attributes of a view |
|
|
Forcibly deleting a view from the database |
Defining a Function
|
Function |
SQL Statement |
|---|---|
|
Creating a function |
|
|
Deleting a function |
Defining a Resource Label
|
Function |
SQL Statement |
|---|---|
|
Creating a resource label |
|
|
Altering a resource label |
|
|
Dropping a resource label |
Defining an Audit Policy
|
Function |
SQL Statement |
|---|---|
|
Creating a unified audit policy |
|
|
Altering a unified audit policy |
|
|
Dropping an audit policy |
Collecting Statistics
For details about how to collect statistics related to the contents of ordinary tables in the database, see ANALYZE.
Clearing a Recycle Bin
M-compatibility provides statements for clearing a recycle bin. For details, see PURGE.
Defining an Object Comment
M-compatibility supports statements for defining or modifying an object comment. For details, see COMMENT.
Creating a Table Based on Query Results
M-compatibility supports statements for creating a table based on query results and inserting queried data into the new table. For details, see SELECT INTO.
Clearing Table Data
M-compatibility supports statements for quickly deleting all rows from a table. For details, see TRUNCATE.
Recycling Storage Space
M-compatibility supports statements for recycling storage space occupied by deleted rows in a table or B-Tree index. For details, see VACUUM.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot