Glossary Item Box

DBACentral for MySQL Submit feedback on this topic   

Relationships

A relationship is a foreign key constraint, which guards the integrity of your data. A relationship links two tables by two or more fields and determines rules for updating and deleting data in these tables.

 

A relationship is built from a "parent" table to a "child" one by fields, which usually has the same data type and size. When you create a relationship, you can select the action to execute after updating and deleting data in the related field of the parent table. The following actions are available:

  • No Action - this enables you to keep the data integrity manually; with this selection relationships are only useful in DBACentral for managing table data, building queries, forms, etc.
  • Restrict - this option strictly forbids updating/deleting data in parent table, if there are linked records in a child table.
  • Cascade - this option cascades all changes in parent table data, i.e. deletes the corresponding related values or updates them to the new values.
  • Set Null - this option sets all related values to NULL on updating or deleting data in parent table.
  • Set Default - this option sets all related values to the default value on updating or deleting data in parent table.

 

DBACentral for MySQL supports two types of relationships, which are absolutely identical in their behavior within the application. Profile relationships are a unique feature of DBACentral. They are stored in profile files along with queries and forms. These relationships can be used with any MySQL version and table type, including $MyISAM$. Unlike them, native MySQL relationships (InnoDB foreign keys) work only with MySQL 4.1 and higher, and require both linked tables to be of $InnoDB$ type.

 

Both of these types can be easily managed within the Relationship Manager in DBACentral for MySQL and are used, besides guarding your data integrity, to lighten the data management, building joins in queries, generating forms, and for other purposes.

 

 

 

 


©2004 MicroOLAP Technologies LTD. All Rights Reserved. All trademarks are the sole property of their respective owners.