Saturday, 15 February 2014

mysql - Generating SQL from an ERD - how are relations mapped into SQL? -


I am using the MySQL workbench EER where I draw my ERD tables (optional / compulsory, non-identifying / recognizable) There are all kind of connections between and I use forward engineering to generate built-in SQL. As far as relationships go, for this an alternative relationship, this creates a tap FK, whereas essentially one tap is not in FK and this is the same.

I mean, on the basis of relationships, it should not be born on the basis of relationship too. Examples? That is, if I have an identity relationship, then when the parent is removed, the child should also be removed, thus a waterfall will be removed

or, in other words, in ERD There is no practical value of relationships done except for the concept other than how your database is based on the papers. For example, to identify compulsory relationship, what should be the SQL code generated?

The database you are referring to is called an relationship database There is something different in management posts.

Your relationship should be implemented as a foreign key. The practical value of the foreign key is that it applies the referential integrity. Cascaded removed are generally not the desired behavior and there is a default referntial entityity action in SQL that does not allow the removal of a line in the parent table if the line is any The other is being referred to in the table. If you want cascaded deletes then you have to specify it. Note that only the InnoDB database in MySQL supports Engineering Engrity.


No comments:

Post a Comment