
Constraints in Database Systems
Explore the different types of constraints in E-R enterprise schema, including mapping cardinalities, keys, and participation constraints. Learn about one-to-one, one-to-many, many-to-one, and many-to-many relationships, as well as primary, super, candidate, and foreign keys.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
SUBJECT NAME: DATABASE SYSEMS SUBJECT CODE: 16SCCCA4 UNIT-IV:CONSTRAINS
CONSTRAINTS An E-R enterprise schema define certain constraints. Mapping cardinalities Keys participation Participation constraints
MAPPING CARDINALITIES Mapping cardinalities express the number of entities to which another entity can be associated via a relationship set. A relationship set R between entity sets A and B, the mapping cardinalities are following.
One-to-one An entity Ais associated with at most one entity in B.and B is associated with at most one entity in A. a1 b1 a2 b2 a3 b3 a4 b4 A B
One-to-many An entity in A is associated with any number(zero or more)of entity in B An entity in B can be associated with at most one entity in A a1 b1 a2 b2 b3 a3 b4 A B
Many-to-one An entity in A is associated with at most one entity in B. An entity in B can be associated with any number(zero or more)of entities in A. a1 b1 a2 b2 a3 b3 a4 A B
many-to-many An entity in A is associated with any number(zero or more)of entity in B.as well as B is associated with any number(zero or more)of entities in A a1 b1 a2 b2 a3 b3 a4 b4 A B
KEYS Primary key Super key Candidate key Foreign key
Primary key Primary key should avoid duplicate data. Primary key must contains Unique values Must never be null Uniquely identify each record in the table.
SUPER KEY A super key is any combination of fields within a table that uniquely identifies each record within that table. Superset of candidate key.
CANDIDATE KEY A subset of a super key. A candidate key is a single field or the last combination of fields that uniquely identifies each record in the table.
FOREIGN KEY Foreign key is a column that creates a relationship between two tables. The purpose of foreign keys is to maintain data integrity. It acts as a reference between two tables as it references the primary key of another table.
PARTICIPATION CONSTRAINTS Participation constraints define the least number of relationship instances in which an entity must compulsorily participate. Types of participation constraints: Participation constraints Total participation Partial participation