Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/ Documentation version: v5.3.2 # Data definitions overview Data definitions refer to the structure of your data in the database. Use data definition language (DDL) statements in GQL to manage that structure. Before defining data structures, you need to understand the following concepts: ## Catalog A catalog is created by the system during the initialization of a service group and serves as a persistent collection of schemas. You can create multiple schemas within a catalog. ## Schema A schema is a logical container for your data. When a service group is initiated, a schema at logical path `/default_schema` is automatically created as the default schema to store resource objects. You can [create a custom schema](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/schema/create/) and [set it as the schema](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/sessions/set/) for the current session. After a schema is created, you can add the following resource objects to it: - Graph type: Describes the types of graph elements (nodes and edges) that may occur in a graph. - Node type: Describes the labels and properties that a node may have. - Edge type: Describes the labels and properties that an edge may have, and the two types of nodes that are connected by the edge. - Graph: An instance of a graph type that stores the actual data in the form of nodes and edges. - Procedure: Built-in or user-defined procedures that can be called in a query. ## Graph type A graph type is a type of a graph, containing a set of node types and edge types. Each graph type has a unique name. ### Node type Each node type comprises: - a node type name. - a set of labels, where each label has a name that is unique within the node type. - a set of properties, where each property comprises: - a name that is unique within the node type. - a [value type](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/). For each node type, you must declare one and only one primary key, which may consist of one or more properties. ### Edge type Each edge type comprises: - an edge type name. - a set of labels, where each label has a name that is unique within the edge type. - a set of properties, where each property comprises: - a name that is unique within the edge type. - a [value type](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/). - two types of nodes that are connected by the edge. - an indication of whether the edge type is directed or undirected. For each edge type, you can declare only one multi-edge key, which may consist of zero or more properties. For more information about graph types, see [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/). ## DDL statements GQL supports the following DDL statements: - SCHEMA - [CREATE SCHEMA](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/schema/create/) - [DROP SCHEMA](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/schema/drop/) - GRAPH TYPE - [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/) - [DROP GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/drop/) - [ALTER GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/alter-graph-type/) - [RENAME GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/rename/) - GRAPH - [CREATE GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/create/) - [CREATE TEMPORARY GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-projection/create/) - [DROP GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/drop/) - [RENAME GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/rename/) - [INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/) - [CREATE NORMAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create/) - [CREATE VECTOR INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-vector/) - [CREATE SPATIAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-geo/) - [CREATE FULLTEXT INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-fulltext/) - [DROP INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/drop/) - TTL - [CREATE TTL](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/ttl/create/) - [DROP TTL](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/ttl/drop/) - [ALTER TTL](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/ttl/alter/) - PROCEDURE - [CREATE PROCEDURE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/create/) - [DROP PROCEDURE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/drop/) - [ALTER PROCEDURE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/alter/)