mysql 工作台列图标是什么意思

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10778561/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:33:06  来源:igfitidea点击:

What do the mysql workbench column icons mean

mysqlsqlmysql-workbench

提问by Di Zou

In MySQL Workbench, when you edit a table, by each column name, there is a colored diamond. Where can I find a document that explains what each color means?

在 MySQL Workbench 中,当您编辑表时,每个列名都有一个彩色菱形。在哪里可以找到解释每种颜色含义的文档?

回答by Jan

enter image description hereenter image description hereKey: (Part of) Primary Key
enter image description hereenter image description hereFilled Diamond: NOT NULL
enter image description hereenter image description hereNot filled Diamond: NULL
enter image description hereenter image description hereenter image description hereRed colored: (Part of) Foreign key
enter image description hereenter image description hereBlue lined Diamond: Simple attribute (no key)

在此处输入图片说明在此处输入图片说明键:(部分)主键
在此处输入图片说明在此处输入图片说明填充菱形:NOT NULL
在此处输入图片说明在此处输入图片说明未填充菱形:NULL
在此处输入图片说明在此处输入图片说明在此处输入图片说明红色:(部分)外键
在此处输入图片说明在此处输入图片说明蓝线菱形:简单属性(无键)

Can be combined for example:
enter image description hereis a Red colored Key so it's a Primary Key which is also a Foreign Key
enter image description hereis a Yellow (non Red) Key so it's only a Primary Key
enter image description hereis a blue lined filled diamond so it's a NOT NULL simple attribute
enter image description hereis a red colored filled diamond so it's a NOT NULL Foreign Key
enter image description hereis a blue lined not filled diamond so it's a simple attribute which can be NULL
enter image description hereis a red colored not filled diamond so it's a Foreign Key which can be NULL

可以组合例如:
在此处输入图片说明是一个红色的键,所以它是一个主键,也是一个外键
在此处输入图片说明是一个黄色(非红色)键,所以它只是一个主键
在此处输入图片说明是一个蓝色内衬的填充菱形,所以它是一个 NOT NULL 简单属性
在此处输入图片说明是一个红色填充菱形,所以它是一个非空外键
在此处输入图片说明是一个蓝色内衬的未填充菱形,所以它是一个简单的属性,可以为 NULL
在此处输入图片说明是一个红色的未填充菱形,所以它是一个外键,可以为 NULL

On a sidenote:
Mind you that MySQL Workbench has a buggy Database > Reverse Engineer (Ctrl-R)option with which you can generate a ERD diagram and that uses these icons. In my experience the v6.x is better than v8.x but both have their quirks/bugs.

旁注:请
注意,MySQL Workbench 有一个有问题的Database > Reverse Engineer (Ctrl-R)选项,您可以使用该选项生成 ERD 图并使用这些图标。根据我的经验,v6.x 比 v8.x 好,但两者都有自己的怪癖/错误。

回答by Andy

To the left of the column name is an icon that indicates whether the column is a member of the primary key. If the icon is a small key, that column belongs to the primary key, otherwise the icon is a blue diamond or a white diamond. A blue diamond indicates the column has NN set. To add or remove a column from the primary key, double-click the icon. You can also add a primary key by checking the PRIMARY KEY check box in the Column Details section of the table editor.

列名左侧是一个图标,指示该列是否是主键的成员。如果图标为小键,则该列属于主键,否则图标为蓝色菱形或白色菱形。蓝色菱形表示该列设置了 NN。要在主键中添加或删除列,请双击该图标。您还可以通过选中表编辑器的“列详细信息”部分中的“主键”复选框来添加主键。

Source: http://dev.mysql.com/doc/workbench/en/wb-table-editor.htmlSection: 7.7.1.3.2

来源:http://dev.mysql.com/doc/workbench/en/wb-table-editor.html 部分:7.7.1.3.2

回答by Digitalis

Using Google, I found this.

使用谷歌,我发现了这一点。

http://dev.mysql.com/doc/workbench/en/wb-using-table-tool.html

http://dev.mysql.com/doc/workbench/en/wb-using-table-tool.html

Is this enough explanation? I'd be happy to help further.

这解释够了吗?我很乐意提供进一步的帮助。