You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.
A data table consists of basic information, field or column information, virtual columns, indexes, and foreign keys. The virtual columns, indexes, and foreign keys are optional and can be configured based on service requirements.
- In the database list of the Home page, locate the target database and click Create Table in the Operation column.
- On the displayed page, specify the details under Basic Information (Table Name is mandatory). Click Next.
- Set the column name, type, length, nullable, primary key, and extended information based on service requirements.
- If you do not need to add virtual columns, indexes, or foreign keys, click Create at the bottom of the page. In the displayed SQL Preview dialog box, click Execute.
- If you need to add virtual columns, indexes, and foreign keys, click Next. Then, set the column name, type, length, nullable, primary key, expression, storage type, comment, and extended information. If you need to set the table index or foreign key, click Next. After the setting, click Create.
When you create a foreign key, the type of columns in the referenced table must be the same as that of included columns, and must be the primary key or have a unique index.
- In the SQL Preview dialog box, click Execute to create a table.