当前位置:网站首页>Use of comment keyword in database
Use of comment keyword in database
2022-07-01 03:35:00 【Yi EBA】
COMMENT Introduction to the use of
effect : Add a comment to a field or column .
1. Add comments to fields when creating tables
CREATE TABLE emp(
emp_id INT PRIMARY KEY AUTO_INCREMENT COMMENT ' Number ',
emp_name CHAR(20) NOT NULL DEFAULT '' COMMENT ' full name ',
salary DECIMAL(10,2) NOT NULL DEFAULT 0 COMMENT ' Wages ',
department CHAR(20) NOT NULL DEFAULT '' COMMENT ' department '
);
2. Add comments to the fields after creating the table
ALTER TABLE emp CHANGE COLUMN department department CHAR(20) NOT NULL DEFAULT '' COMMENT ' department ';
3. View comments for all fields in the table
- The way 1
show full columns from tablename;
SHOW FULL COLUMNS FROM emp;

- The way 2
SELECT * FROM COLUMNS WHERE TABLE_SCHEMA='dbname' AND TABLE_NAME='tablename';

4. Add comments to the table when creating it
CREATE TABLE test(
field_name INT
)COMMENT=" The comment ";
5. Add comments to the table after it is created
alter table tablename comment ' Table notes ';
6. See table notes
- The way 1
show create table tablename;

- The way 2
USE information_schema;
SELECT * FROM TABLES WHERE TABLE_SCHEMA='dbname' AND TABLE_NAME='tablename';

——————END-2022-06-11——————
边栏推荐
- Depth first traversal of C implementation Diagram -- non recursive code
- JS daily development tips (continuous update)
- shell脚本使用两个横杠接收外部参数
- Pathmeasure implements loading animation
- Gorilla/mux framework (RK boot): RPC error code design
- IPv4 and IPv6, LAN and WAN, gateway, public IP and private IP, IP address, subnet mask, network segment, network number, host number, network address, host address, and IP segment / number - what does
- EtherCAT简介
- 多元线性回归
- 监听器 Listener
- Feign远程调用和Getaway网关
猜你喜欢

idea插件备份表

The value of the second servo encoder is linked to the NC virtual axis of Beifu PLC for display

pytorch训练深度学习网络设置cuda指定的GPU可见

C语言多线程编程入门学习笔记

Research on target recognition and tracking based on 3D laser point cloud

Nacos

小程序容器技术与物联网IoT的结合点

Stop saying that you can't solve the "cross domain" problem

Cygwin的下载和安装配置

Edlines: a real time line segment detector with a false detection control
随机推荐
Basic concept and classification of sorting
串口接收数据方案设计
实现pow(x,n)函数
multiple linear regression
深度学习中的随机种子torch.manual_seed(number)、torch.cuda.manual_seed(number)
Md5sum operation
JS daily development tips (continuous update)
The method to measure the similarity of two vectors: cosine similarity, pytorch calculate cosine similarity: torch nn. CosineSimilarity(dim=1, eps=1e-08)
[小样本分割]论文解读Prior Guided Feature Enrichment Network for Few-Shot Segmentation
终极套娃 2.0 | 云原生交付的封装
Hello World generation
数据交换 JSON
CX5120控制汇川IS620N伺服报错E15解决方案
C#实现基于广度优先BFS求解无权图最短路径----完整程序展示
Pytest -- plug-in writing
C language EXECL function
md5sum操作
leetcode 1482 猜猜看啊,这道题目怎么二分?
网页不能右键 F12 查看源代码解决方案
GCC usage, makefile summary