How to create a Table
Step-by-Step Guide
Step 1: Access the Data Objects Section
Navigate to the Data Object section in your Orchestrator toolbar.
Step 2: Create a New Table Data Object
Click the "Table" button.
Step 3: Fill Out the Table Form
After clicking the button, you'll see the following screen. Fill out the form to create your table. Below is an explanation of each part of the form.
- Properties tab: Fill out the name of the table, you also have the option to add a description.
- Fields Tab: Add multiple columns/fields to your table. Specify the name, type, maximum size of each element, whether the field is a primary key, a hash/index key, whether elements can be null, if the column is auto-incremental, and set default values for each field.
The following table explain each part of the screen:
Section | Description |
---|---|
Name | Enter the name of the field. |
Type | Specifies the data type of the field. |
Size | Specifies the storage size of the field. For example, INT(11) means an integer with a maximum display width of 11 digits. Size can vary based on the data type and the specified length or precision. |
Primary Key | A unique identifier for each record in a table. A table can have only one primary key, which can be composed of one or multiple columns (composite key). It ensures that each record is unique and can be referenced by other tables. |
Hash / Index Key | Used to optimize the performance of queries by creating indexes. Hash indexes use a hash function to map keys to their associated values, while other types of indexes (like B-trees) organize data to allow efficient retrieval. Indexes speed up search operations but can slow down data insertion, update, and deletion. |
Is Null | Determines whether a field can contain NULL values. A field defined as NOT NULL must have a value; it cannot be left empty. Allowing NULL values can be useful when the data might be optional or unknown. |
Auto-increment | Automatically generates a unique number for new records in a table. Typically used for primary key fields. Each new record gets the next number in the sequence without manual input. |
Default | Sets a predefined value for a field if no value is specified when a record is inserted. This ensures that a field always has a valid value, avoiding NULLs or blanks unless explicitly allowed. |
In the following table we explain all the available field types:
Field Type | Description |
---|---|
INT | Stores integer values. Commonly used for primary keys, counters, or any data that represents whole numbers. |
DECIMAL | Stores fixed-point numbers with a specified precision and scale. Useful for storing financial data where precision is critical. |
VARCHAR | Stores variable-length strings. Commonly used for text data where the length can vary, such as names or email addresses. |
DATE | Stores date values in 'YYYY-MM-DD' format. Used for storing dates without time. |
DATETIME | Stores date and time values in 'YYYY-MM-DD HH:MM:SS' format. Useful for recording precise moments in time. |
TIME | Stores time values in 'HH:MM:SS' format. Used for storing time of day. |
TEXT | Stores large amounts of text data. Suitable for storing paragraphs of text, such as descriptions or comments. |
LONGTEXT | Stores very large amounts of text data. Ideal for storing extensive text, such as articles, blog posts, or lengthy descriptions. |
JSON | Stores JSON (JavaScript Object Notation) data. Useful for storing structured data in a flexible, schema-less format. |
GEOGRAPHYPOINT | Stores geographic coordinates (latitude and longitude) for a single point. Useful for mapping and spatial queries. |
GEOGRAPHY | Stores complex geographic data types, such as polygons, lines, and multi-point shapes. Useful for advanced spatial data applications. |
All three database management systems use SQL as their query language.
Step 4: View Your Table
After creating your table, you can view it in the Data Object section, where it will be listed with all the other table in the design repository.
For more information on the available actions for the table, refer to the Data Objects Actions documentation.
Updated 5 months ago
Whatβs Next