When working with the CDS, you need to try to keep information about different types of data in separate entities. This is known as data normalization. Relationships define how records are related to one another in the CDS.
Each entity has a primary key to provide a unique reference to the records in the entity. In the CDS, the primary key is a Global Unique Identifier (GUID) that is generated automatically by the CDS when a record is created. Relationships are created by adding a reference to the primary key. This is known as a foreign key. In the CDS, relationships are created by using a field on one entity to hold the foreign key value. This foreign key is a pointer to the primary key on the other entity.
Two types of relationship are supported in the CDS:
- One-to-many (1:N): A building has many floors, but each floor is for one building.
- Many-to-many (N:N): Each contact attends several events, and each event is attended by several contacts.
One-to-one relationships...