MAPPING CARDINALITIES
Cardinality:
The number of times an entity from an entity set takes part in a particular relationship set is understood as its cardinality. Cardinality can appear in various ways:
1. One-to-one: A relationship is one-to-one when each entity in each set of entities can only participate in it once. Assume that a man can only marry one female and a female can only marry one male. As a result, the connections are one-to-one.
2. Many to One: When entities in one entity set may only participate once within the relationship set, while entities in another entity set can participate several times within the relationship set, the cardinality is many to at least one. Assume that a student can only take one course, but that one course will be taken by several students. The cardinality will then be n to 1. One course can have many students, but there can only be one course for one student, in keeping with this statement.
3. Many to Many: When entities from all entity sets can participate during a connection over once, the cardinality is many to several. Assume that a student may take many courses, and that one course may be taken by multiple students. As a result, the link are going to be many to several.
DATABASE NORMALIZATION
Normalization may be a database design approach that eliminates undesired features like insertion, update, and deletion anomalies. Normalization rules break huge tables into smaller tables and use relationships to attach them. The goal of SQL normalization is to get rid of superfluous (repetitive) data and guarantee that data is stored correctly.
Normalization of Databases A case study can facilitate your understanding of an example more simply. Assume a video library incorporates a database of flicks that are rented out.
The process of structuring data in an exceedingly large database is thought of as normalization. This comprises the creation of tables and also the establishment of linkages between those tables in accordance with rules aimed toward preserving the information while also making the database more adaptable by avoiding redundancy and inconsistent reliance.
Redundant data consumes space and causes maintenance issues. If data that exists in more than one location is modified, the information must be changed in all locations. the identical way. A change in an exceedingly customer’s address is significantly easier to implement if the information is merely saved within the Customers table and nowhere else within the database.
Database normalization follows some guidelines. Each rule is spoken as a “normal form.” The database is taken into account to be in “first normal form” if the primary rule is followed. The database is regarded to be in “third normal form” if the primary three requirements are followed. Although higher degrees of normalization are feasible, the third normal form is believed to be the most important for many purposes.
Real-world scenarios, like many formal rules and specifications, don’t always result in perfect compliance. Normalization, in general, necessitates the creation of recent tables, which some customers find inconvenient. If you opt to interrupt one in every of the primary three criteria of normalization, confirm your application anticipates any potential difficulties, like duplicate data and inconsistent dependencies.