WEBDEV Concepts

166 Part 5: Databases Complement link For a complement link: • Each record from a data file (Product) has no matching records or has one matching record in another data file (Details). • Each record in the other data file (Details) has a matching record in the first data file (Product). Complement links are quite common. They are used when a record can have additional optional information. In a complement link, the key of the Product data file is copied to the Details data file. To ensure the maximum cardinality of 1, it remains a unique key. Since this key is unique, it is not possible to insert more than one record in the Details data file for a record in Product. Product is the owner data file and Details is the member data file. Shared link For a shared link, the same record in a data file (Supplier) can be shared by several records in another data file (Product). In a shared link, the key of the Supplier data file is copied to the Product data file. It becomes a multiple key to optimize the speed of the integrity check. Supplier is the owner data file and Product is the member data file. Depending on the cardinality, we can distinguish between four types of shared links: • Shared link with a 0,n - 0,1 cardinality. • Shared link with a 0,n - 1,1 cardinality. • Shared link with a 1,n - 0,1 cardinality. • Shared link with a 1,n - 1,1 cardinality. Shared link with a 0,n - 0,1 cardinality With this type of link: • an owner may have no member (a supplier does not necessarily have a product). • a member may have no owner (a product does not necessarily have a supplier). Shared link with a 0,n - 1,1 cardinality With this type of link: • an owner may have no member (a supplier may have no product). • each member has a single owner (each product has a single supplier). Remark : This type of link is quite common. WINDEV allows you to automatically create windows that manage data files with a 0,N - 1,1 relationship. Shared link with a 1,n - 0,1 cardinality With this type of link: • each owner has at least one member (a supplier has at least one product). • a member may have no owner (a product may have no supplier).

RkJQdWJsaXNoZXIy NDQ0OA==