Appendix: SQL Syntax（4）
Tags: opengauss
Published: 2023-03-10 08:13:20

**COMMENT**
Defines or changes the comment of an object.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azz2rw8wnc43iutq19b1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dewg083p6ww0hj0g687v.png)

**COMMIT**
Commits all operations of a transaction.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0jasrxtqjyub4cmx42e.png)

**COMMIT PREPARED**
Commits a prepared two-phase transaction.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oi4tjxl8k50qluofvzhq.png)

**COPY**
Copies data between tables and files.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwh9k0z6wdawrb44ewfk.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vt69dnuwlg0w6syrn23i.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3e57vk7aafuzwjit4u9e.png)

**CREATE CLIENT MASTER KEY**
Creates a CMK object that can be used to encrypt a CEK object.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ynh7lljj84ymgtgc40i.png)

**CREATE COLUMN ENCRYPTION KEY**
Creates a CEK that can be used to encrypt a specified column in a table.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cioi6gqeqe4ektw4uj92.png)

**CREATE DATA SOURCE**
Creates an external data source, which defines the information about the database that openGauss will connect to.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70ne9xr8mw43fqrd3xv2.png)

**CREATE DATABASE**
Creates a database. By default, the new database will be created only by cloning the standard system database **template0**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4agnf44jvqh6w6x9ia8r.png)

**CREATE DIRECTORY**
Creates a directory. The directory defines an alias for a path in the server file system and is used to store data files used by users.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3i708hnfi6svmilkp49.png)

**CREATE EXTENSION**
Installs an extension.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r62s0tzkuldyecn3eclk.png)

**CREATE FOREIGN TABLE**
Creates a foreign table.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp9h1d9f8cnm01qzft4g.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nn256sr2mhig4ivxww9x.png)

**CREATE FUNCTION**
Creates a function.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hl8zc5k9wd28ncmnjhq.png)

**CREATE GROUP**
Creates a user group.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xlxc2v88neczw0rj3i4f.png)

**CREATE INDEX**
Create an index on a specified table.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h307rl9rrwdbh8bxqstt.png)

**CREATE LANGUAGE**
Defines a new procedural language. A standalone or centralized system does not support creating procedural languages.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zdwpnvoxzcu7pygvgtl.png)

**CREATE MASKING POLICY**
Creates a masking policy.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zmiak5nhb0aqi40nxg8.png)

**CREATE MATERIALIZED VIEW**
Creates a complete-refresh materialized view that can be refreshed by using **REFRESH MATERIALIZED VIEW** to refresh the data in the materialized view.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xumk2hz328h2jeywebxr.png)

**CREATE MODEL**
Trains a machine learning model and saves the model.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqg9qdnhiuxmir22i4x6.png)

**CREATE OPERATOR**
Defines a new operator.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnjpixl18f0chtmix4i4.png)

**CREATE PACKAGE**
Creates a package.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97jcgj9zakcizkzydaga.png)