Home  >  Q&A  >  body text

mysql-workbench - mysql workbench的虚线和实线有啥区别?

就是链接两张表的时候,有虚线实线两种,我试了,貌似都一样啊?都是在第一次点的那个表里新增一个外键第二次点击的那个表的主键(有点绕)!

阿神阿神2742 days ago987

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 11:56:36

    If it is implemented, it means that the foreign key value from the table cannot exist independently. To show it in the table, you combine your "foreign key and id" and set it as the primary key. In this case.
    When a foreign key triggers ondelete or onchange, it cannot be set to set null. Because the primary key "foreign key and id" of the slave table cannot have a null value (that is, the foreign key part of "foreign key and id" cannot be space-time)
    Generally speaking, dotted lines are used for 1:1 and 1:n. It is better to use solid lines when n:m only represents the relationship between tables. Because the records in the main table disappear, relying on the corresponding relationship between the records is useless. If the corresponding relationship is not simply expressed, dotted lines should be used to meet the requirements.

    reply
    0
  • Cancelreply