我如何评论 table - MariaDB

How can I comment on a table - MariaDB

我一直在尝试对我用 comment = 'this is a comment'

创建的 table 发表评论

但它总是会导致错误。我试过以下列方式放置它:

create table info comment = 'this is a comment about table info' (
...
); 
create table info (
places varchar(15) not null,
solar_system varchar(20),
primary key (places),
comment = 'this is a comment about table info'
);
create table info (
places varchar(15) not null,
solar_system varchar(20),
comment = 'this is a comment about table info',
primary key (places)
);
create table info (comment = 'this is a comment about table info',
places varchar(15) not null,
solar_system varchar(20),
primary key (places)
);

我应该怎么做才能让 table 上的评论生效?

你可以评论columns and tables

CREATE TABLE example (
  example_column INT COMMENT "This is an example column",
  another_column2 VARCHAR(100) COMMENT "One more column"
) COMMENT="This is a comment about table";

所以在你的情况下

create table info (
    places varchar(15) not null,
    solar_system varchar(20),
    primary key (places)
) comment = 'this is a comment about table info';