In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about how to add notes in MySQL, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
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 test modify column id int not null default 0 comment 'test table id'
Check the comments for all the fields of the existing table?
You can view it with the command: show full columns from table. Examples are as follows:
Show full columns from test; writes comments on create table test1 (comments on field_name int comment 'fields') comment=' table when creating tables; comments on modified tables alter table test1 comment 'comments on modified tables'; comments on modified fields alter table test1 modify column field_name int comment 'modified field comments' -- Note: the way to view table comments by copying field names and field types-- look at show create table test1; in the generated SQL statement-- look at use information_schema; select * from TABLES where TABLE_SCHEMA='my_db' and TABLE_NAME='test1'\ G in the table of metadata-- show show full columns from test1 -- select * from COLUMNS where TABLE_SCHEMA='my_db' and TABLE_NAME='test1'\ G above in the metadata table is how to add comments in MySQL. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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.