WEBDEV Concepts

Part 5: Databases 165 3.3 Advanced cardinalities Cardinalities can be defined more precisely. This is referred to as advanced cardinalities . These cardinalities allow you to specify exactly the minimum and maximum cardinality. To define the advanced cardinalities, check "Display advanced cardinalities" in the link description. Example of advanced cardinalities : This example presents two different cardinalities: • 0,1 cardinality : A person can be a member of a single sport club. This person does not have to belong to a sport club. • 0,10 cardinality : A club can have 0 to 10 members. 3.4 Referential integrity Referential integrity in a database is a set of constraints that maintains consistency of data in a relationship between two data files. Referential integrity checks that: • if a record is deleted from the owner data file, the matching records in the member data files are also deleted, • if a record is added to a member data file, there is a matching record in the owner data file, • if a record is updated in the owner file, the unique key doesn’t change, etc.The referential integrity is checked based on the nature of the link between the data files. For more details on referential integrity, see the online help. 3.5 Types of links There are different types of links between data files: • parallel • optional • complement • shared • complex Parallel link In a parallel link, each record found in a data file (Product) is linked to a record in another data file (Info), and conversely . In a parallel link, the identifier of the Product data file is copied to the Info data file. This identifier is also a unique key in the Info data file. Product is the owner data file and Info is the member data file. Remark : This type of link is rare because the two data files can be combined into one. The parallelism of records in the data file is respected if the following operations are run simultaneously on the two data files: • creation of a record. • deletion of a record. • reindexing with compression. Optional link For an optional link: • Each record of a data file (Category) has no matching records or has one matching record in the other data file (Group). • Each record of the other data file (Group) is associated with no record or with a single record in the first data file (Category). An optional link is established by copying the identifier from one data file to the other.

RkJQdWJsaXNoZXIy NDQ0OA==