280 likes | 288 Vues
e – Lesson Module for C-16 Curriculum. State Board of Technical Education & Training Andhra Pradesh. Year/Semester : III Semester Branch : Computer Engineering Subject : CM-305, DBMS Topic : Concepts of DBMS & RDBMS Sub Topic : Explain Mapping Constraints Duration : 50 min.
E N D
e – Lesson Module for C-16 Curriculum State Board of Technical Education & Training Andhra Pradesh Year/Semester : III Semester Branch : Computer Engineering Subject : CM-305,DBMS Topic : Concepts of DBMS & RDBMS Sub Topic : Explain Mapping Constraints Duration : 50 min Prepared by K.Padmaja, Lecturer in CME K.Subrahmanyam, Lecturer in CME At A.A.N.M&V.V.R.S.R POLYTECHNIC , GUDLAVALLERU C_16_CME_305_1.15
Main objectives of this lesson On completion of this period, you would be able to • Know about Mapping constraints C_16_CME_305_1.15
RECAP In the previous lesson, you have learnt • About super key • About candidate key • About primary key C_16_CME_305_1.15
Super key: A super key is either a single or a combination of attributes that can be used to uniquely identify a database record. A table might have many combinations that create super keys. Candidate key: A candidate key is a combination of attributes that can be uniquely used to identify a database record without referring to any other data. Primary key: Primary key is one/more columns in a table used to uniquely identify each row in a table C_16_CME_305_1.15
Do you know what is meant by mapping? • A mathematical relation such that each element of a given set is associated with an element of another set C_16_CME_305_1.15
What is constraint? • A constraint is a restriction on the degree of freedom you have in proceeding a solution C_16_CME_305_1.15
Mapping Constraints • An entity relationship enterprise schema can define certain constraints called mapping constraints • The most important types of mapping constraints are • Mapping Cardinalities • Existence dependencies C_16_CME_305_1.15
Mapping Cardinalities • Mapping cardinalities are most useful for describing binary relationship-sets which involve two entity sets • Mapping cardinalities express the number of entities to which another entity can be associated via a relationship set C_16_CME_305_1.15
The mapping cardinality can be one of the following • One to one • One to Many • Many to One • Many to Many C_16_CME_305_1.15
One to One: • An entity in A is associated with at most one entity in B and an entity in B is associated with at most one entity in A • E.g:- Husband-----------Wife Student-------------Pin no C_16_CME_305_1.15
One to One A B a1 b1 b2 a2 b3 a3 b4 a4 C_16_CME_305_1.15
One to Many • An entity in A is associated with any number of entities in B.However an entity in B can be associated with at most one entity in A • E.g:- Father------------Children Class--------------Students C_16_CME_305_1.15
One to Many A B b1 a1 b2 a2 b3 a3 b4 b5 C_16_CME_305_1.15
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 of entities in A • E.g:- Goods---------------Vendor Books-----------------Publisher C_16_CME_305_1.15
Many to one A B a1 b1 a2 b2 a3 a4 b3 a5 C_16_CME_305_1.15
Many to Many • An entity in A is associated with any number of entities in B and an entity in B is associated with any number of entities in A • E.g:- Students---------Hobbies C_16_CME_305_1.15
Many to Many A B a1 b1 b2 a2 b3 a3 b4 a4 C_16_CME_305_1.15
Existence Dependencies • If the existence of an entity A depends on the existence of entity B, then A is said to be existence dependent on B • If B is deleted then A is also deleted and thus entity B is said to be a dominant entity and A is said to be a subordinate entity C_16_CME_305_1.15
Summary We have discussed • Various Mapping Cardinalities • Existence Dependencies C_16_CME_305_1.15
Assignment questions 1) Explain about mapping constraints? C_16_CME_305_1.15
Quiz C_16_CME_305_1.15
How many types of mapping cardinalities are there in Mapping Constraints? • Three • Four • Five C_16_CME_305_1.15
How many types of mapping cardinalities are there in Mapping Constraints? • Three • Four • Five C_16_CME_305_1.15
An entity in A is associated with at most one entity in B and an entity in B is associated with at most one entity in A is called • One to many • Many to Many • One to One C_16_CME_305_1.15
2. An entity in A is associated with at most one entity in B and an entity in B is associated with at most one entity in A is called • One to many • Many to Many • One to One C_16_CME_305_1.15
3. If the existence of entity A depends on the existence of entity B, then A is said to be • Existence dependent on B • Existence dependent on A • Existence dependent on C C_16_CME_305_1.15
3. If the existence of entity A depends on the existence of entity B, then A is said to be • Existence dependent on B • Existence dependent on A • Existence dependent on C C_16_CME_305_1.15
Thank you C_16_CME_305_1.15