Relational model doesn’t have standard graphical representation and is simply set of tuples, which is why it’s used for logical/internal modeling and not conceptual modeling. Relational model is used to build out logical and internal data models and is represented as a collection of relations, which is basically a table of values or entity types. In a relational model, entity type is relation, entity is a tuple, attribute type is a column name, and attribute is a cell, if you are comparing it to conceptual model sets like an EER model.
Let’s talk about domains when it comes to relations in a relational model. Domains are values for an attribute types and they can be specified as what is admissible. For example, for relation billing with attribute types (producer number, product name, quantity of products), we can specify the quantity to have a specific value by adding range to it in a relational model. Cartesian product specifies the combinations of domains in multiple relation and will list all possible combinations and the new relation will then be subset. Critical thing to note about domain is its constraint, which states that value of each attribute type must be atomic and single value.
Critical concept and fundamental building block in a relational model is keys, which are what is used to not only uniquely identify all the tuples but to create relationships as well. Key constraint specifies that every relation must have one key to ensure tuples are uniquely identified. Note that relation is made up of multiple tuples, which means all tuples has to be distinct. This is why you need a unique key to identify the tuples and to create relationships. First we have superkey, which is a subset of attribute types that states that no two tuples in any relation state should have same combination of values. If there are more than one key then the keys will be considered candidate key with one being assigned as primary key and other being the alternative key.
Primary key identifies tuples in the relation in a unique way and establishes connections to other relations by becoming the foreign key in other relation and alternative key is pretty much alternative to primary key. Primary key should always satisfy a rule of not being a NOT NULL constraint, because if it is null, it won’t be able to uniquely identify a tuple. This rule of satisfying a NOT NULL constraint is called entity integrity constraint. Alternative keys can be defined to have a NOT NULL or NULL constraint. Foreign key is a way to establish a connection between relations. But it must meet a condition called referential integrity constraint, which states that foreign key must have the same domain as the primary key attribute types it is referred to and also, it needs to occur as a value of either NULL or the primary key value. There are two ways to utilize foreign keys. In a relationship that is not N:M, you can use one foreign key in another relation while in a N:M relationship, you will need to create a new relation and utilize two foreign keys that will become the primary key in the new relation. In a N:M relationship type, it will create multi valued attribute type in both ways, so you can’t utilize foreign key in another relation and vice versa. Primary keys in a relational model are underlined and foreign keys are in italics.
So we talked about four different relational constraints so far: domain, key, entity integrity, and referential integrity. Domain constraint basically states that attribute types value must be single and atomic. Key constraint basically states that every relation should have a key to uniquely identify its tuples, like the primary key. In an entity integrity constraint, attributes that make up the primary key shouldn’t be NULL, which basically supports key constraint. Then we have referential integrity constraint that focuses on the foreign key. The foreign key in referential integrity constraint should have the same domain as the primary key it is associated with and should occur as value of either the primary key itself or show as NULL.
In a relational model, normalization is done to ensure removal of redundant data. During the process of data insertion, deletion, or update, normalization is conducted to ensure no anomalies within datasets.