In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces navicat how to display field comments, the article is very detailed, has a certain reference value, interested friends must read it!
In the MySQL database, comments for fields or columns are added with the property comment.
In the script that creates the new table, you can add comments by adding the comment attribute to the field definition script.
The sample code is as follows:
Create table test (id int not null default 0 comment 'user id')
If you have already built the table, you can also use the command to modify the field, and then add the comment attribute definition, you can add comments.
The sample code is as follows:
Alter table testchange column id id int not null default 0 comment 'test table id'
Check the comments for all the fields of the existing table?
You can use the command:
Show full columns from table
Examples are as follows:
Show full columns from test
1. Write comments when you create the table
Create table test1 (comments for field_name int comment 'field') comments for the comment=' table'
2. Modify the notes of the table
Alter table test1 comment 'comments on modified tables'
3. Modify the comments of the field
Alter table test1 modify column field_name int comment 'modified field comments'
-Note: just write the field name and field type.
4. The method of viewing the comments on the table
-look in the generated SQL statement
Show create table test1
-look inside the metadata table
Use information_schema;select * from TABLES where TABLE_SCHEMA='my_db' and TABLE_NAME='test1'\ G
5. How to view field comments
-showshow full columns from test1
-look inside the metadata table
Select * from COLUMNS where TABLE_SCHEMA='my_db' and TABLE_NAME='test1'\ G
It is easier to add comments when using the tool Navicat.
Right-select the table that needs to be annotated, and you can see the annotated COMMENT under DDL in the object information.
Right-click "Design Table", you can see the comments below, and click "add".
The above is all the content of the article "how navicat displays field comments". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.