What is a Data Model?
A data model is a representation of the data, its structure and how they relate to one another, including the constraints for processing it.
It is crucial for the design of databases such as a Zoho CRM or a Zoho Creator application.
Main elements of a Data Model
"Entities" : These are the real-world objects or concepts that the data will represent, such as 'Contacts', 'Accounts', 'Products', 'Deals' or 'Orders'. In a physical database, they are generally named "Tables".
"Attributes" : Attributes are the properties or details about an entity, such as a Contact's First Name, Last Name, Mobile, Email or a Deal's Amount and Date.
"Relationships" : These define how entities relate to one another. For instance, a Contact might place multiple Orders, so there is a relationship between 'Contacts' and 'Orders'.
"Constraints" : These are rules that ensure the integrity of the data, such as a requirement that all Contact Records have a unique customer ID and that the Last Name is mandatory.
Entities, Attributesand Constraints Representation
Each entity (table) is represented by a box, with the attributes (fields) listed in it
The 🔑 key symbol represents the primary key of a record. It contains unique mandatory values.
The ⭐star symbol represents mandatory values (but not unique).
The ♦️ diamond symbol represents unique values (but not mandatory, so it can be empty).
Cardinalities
The entity relationships are called "Cardinalities". These are the standards used to define if a relation is mandatory, one-to-many, many-to-many, etc.
In the following example, the cardinality between Contact and Account can be read as
One Contact can have zero or one Account attached (frequently the employer).
One Account can have zero or multiple Contacts attached (frequently its employees).