Create Table

Create Table

The first step when working with StackPuz is to create a table.

To create a table, right-click the Tables icon and select "Add Table".

Create Table

Table Structure

The Table Structure tab allows you to design the table by adding, editing, deleting, or reordering the table's columns. You can define the attributes of each column, which include:

  • Name: The name of the column.
  • Data Type: The data type of the column.
  • Length: The maximum length of the column's value.
  • Key: Indicates if the column is a PRIMARY KEY.
  • Unique: Specifies if the column has a UNIQUE constraint.
  • Required: Indicates if the column has a NOT NULL constraint.
  • Auto Increment: Indicates if the column uses AUTO INCREMENT to automatically generate unique numbers.
  • Default: The default value assigned to the column.

If you have experience in database design and development, you should find it easy to navigate and work with this screen. The intuitive interface and familiar functionalities will allow you to efficiently create and manage your database tables without encountering any issues.

Table Structure

Audit Columns

Audit columns help you track changes to row data by providing the following information:

  • Who created the row: The user responsible for creating the row.
  • When the row was created: The timestamp indicating when the row was added to the database.
  • Who updated the row: The user responsible for modifying the row.
  • When the row was updated: The timestamp indicating when the row was last modified.

Using audit columns is optional. You can implement all of them, select only some, or choose not to use them at all, depending on your specific requirements.

Note

The audit columns are system columns whose values are managed by the system. As a result, you cannot use them as input elements in the view.

You can add audit columns by clicking the "Add Audit Columns" button.

Audit Columns

You can also modify the name of each audit column in the Database Settings tab of your project.

Audit Column Name

Test Data

Test Data is a valuable feature in StackPuz that saves you time and effort by automatically generating test data with various attributes.

You can configure the test data for the table using the Data Setting column, where you can select the type of data values and adjust the settings for how the data is generated.

Test Data Setting

SQL Script

The SQL Script feature is a SQL generator designed to help you quickly create tables (DDL) and import test data into the database.

To use it, simply click the "Copy" icon to copy the generated SQL. You can then paste it into any database client software and execute the SQL commands at your convenience.

SQL Script

Note

The SQL Script is also available in the Target section of the project. This section generates SQL for all tables within the project, allowing you to create all tables and import all test data into the database in one click!

SQL Script