In: Computer Science
Define the following terms:
a. Cardinalities
b. Weak Entity Types
c. Categorization
d. Aggregation
a. Cardinalities:-
The definition of cardinality that matters a lot for query performance is data cardinality. This is all about how many distinct values are in a column.The first meaning of cardinality is when you’re designing the database—what’s called data modeling. In this sense, cardinality means whether a relationship is one-to-one, many-to-one, or many-to-many. So you’re really talking about the relationship cardinality.
Cardinality’s official, non-database dictionary definition is mathematical: the number of values in a set. When applied to databases, the meaning is a bit different: it’s the number of distinct values in a table column, relative to the number of rows in the table. Repeated values in the column don’t count.
We usually don’t talk about cardinality as a number, though. It’s more common to simply talk about “high” and “low” cardinality. A lot of distinct values is high cardinality; a lot of repeated values is low cardinality.
Picture a product description table in an e-commerce database:
The ProductID
column is going to be
high-cardinality because it’s probably the primary key of that
table, so it’s totally unique. If there’s a thousand rows in the
table, there’ll be a thousand different ProductID
values. The Category
column will have a lot of
repetition, and it’ll be low or medium cardinality: maybe 50 or 100
different Category
values. Name
is
probably high cardinality, unless there’s more to this table than
meets the eye (such as multiple rows for different product colors
and other variations).
b. Weak Entity Types:-
The weak entity in DBMS do not have a primary key and are dependent on the parent entity. It mainly depends on other entities.
Weak Entity is represented by double rectangle −
The example of strong and weak entity can be understood by the below figure.
The Strong Entity is Professor, whereas Dependent is a Weak Entity.
ID is the primary key (represented with a line) and Name in Dependent entity is called Partial Key (represented with a dotted line).
c. Categorization:-
The category concept: An extension to the entity-relationship model.
An enhanced version of the Entity-Relationship (ER) data model called the Entity-Category-Relationship (ECR) data model is presented. The principal extension is the introduction of the concept of a category. Categories permit the grouping of entities from different entity types according to the roles they play in a relationship, as well as the representation of ISA and generalization hierarchies.
d. Aggregation:-
In aggregation, the relation between two entities is treated as a single entity. In aggregation, relationship with its corresponding entities is aggregated into a higher level entity.
For example: Center entity offers the Course entity act as a single entity in the relationship which is in a relationship with another entity visitor. In the real world, if a visitor visits a coaching center then he will never enquiry about the Course only or just about the Center instead he will ask the enquiry about both.