4
Yes it is possible just add the clasp COMMENT
in the definition of the column or table.
CREATE TABLE pessoa(
id INT NOT NULL AUTO_INCREMENT COMMENT 'chave primária',
nome VARCHAR(50) COMMENT 'coluna com o nome',
email VARCHAR(50) COMMENT 'contato da pessoas',
PRIMARY KEY(id)
)COMMENT 'tabela contendo informações de pessoas'
To retrieve comments from tables/columns you can use the command:
SHOW FULL COLUMNS FROM pessoa
For a more refined query use the information_schema:
SELECT table_name, table_comment FROM information_schema.tables
WHERE table_schema = 'nome_da_database'
If you use the Workbench click on the icon with the letter i
on the flap info
the comments in the table and in the columns
comments for each column.
Based on: Show Comment of Fields FROM Mysql Table
has how to print?
– Italo Rodrigo
@Italorodrigo already updated the answer.
– rray