Vous êtes sur la page 1sur 3

Non identifying relationships between strong entities: A strong entity type is one that exist independently of other entity

type. Instances of strong entity type alw3ays have unique identifiers. Examples of strong entities are : STUDENT,
COURSE

STUDENT Sno Name

Enrolls

COURSE Cno Cname Duration

STUDENT(Sno primarykey,Name ) COURSE(Cno primary key,Cname,Duration) Sno is identifier of STUDENT entity , and CNo is identifier of COUSE .STUDENT and COURSE are strong entities and there is no identification relationship between them because both having their own identifiers. Identifying relationships between ID-dependent entities: a weak entity does not have its own identifier. A WEAK ENTITY TYPE whose existence depends on some other entity type. The entity type on which the weak entity depends is called identifying owner. The relationship between a weak entity type and its owner is called identifying relationship. Example: EMPLOYEE(Empid DEPENDENT(Dependentname,DOB) primary key,EmpName ) ,

DEPENDENT is a weak entity which does not have identifier and it is depend on the EMPLOYEE identifier.

Supertype and subtype relationships : A subtype is a sub grouping of the entities in an array type that is meaning full to the organization. A super type is a generic entity type that has a relationship with one or more subtypes. A sub type is an entity type in its own right. An entity instance of sub type represents the same entity instance of the super type. There is inheritance relationship between super type and subtype. Generalization is a relationship by defining more general entity type from a set of more specialized entity types.

Examples: OUTPATIENT (Patientid,patientname,admitdate,checkdate) INPATIENT(Patientid,patientname,admitdate,DateofDischarge) These both are having common attributes and also having special attributes. If we generalized them by identitying common attributes such as Patientid,patientname,admitdate Then the entities are modified as super type and subtype as follows: Supertype entity PATIENT(Patientid primary key ,patientname,admitdate) Subtype entityes are OUTPATIENT (checkdate) INPATIENT(DateofDischarge) Generalization relationship contains HAS A-RELATIONSHIP. Recursive relationships: A recursive relationship can be defined as A relationship that is expressed about multiple records within one table. As an example if we take an employee table then there are some employees who are supervisor and some who are being supervised. This is the relationship of Supervisor and supervisee is called a recursive relationship.

EMPLOYEE

Supervised

entity pattern is transformed into database tables. :


1.

Mapping of Regular Entity Types For each regular entity type, create a relation R that includes all the simple attributes of E Called entity relations.

2.

For each weak entity type, create a relation R and include all simple attributes of the entity type as attributes of R Include primary key attribute of owner as foreign key attributes of R. Identify relations that correspond to

3. For each binary 1:1 relationship type entity types participating in R .

4. For each regular binary 1:N relationship type Identify relation that represents participating entity type at N-side of relationship type Include primary key of other entity type as foreign key in S Include simple attributes of 1:N relationship type as attributes of S Use the relationship relation (cross-reference)option as in the third option for binary 1:1 relationships 5. Mapping of Binary M:N Relationship Types For each binary M:N relationship type Create a new relation S include primary key of participating entity types as foreign key attributes in S include any simple attributes of M:N relationship type 6. Mapping of Multivalued Attributes for each multivalued attribute Create a new relation but the primary key of R is the combination of A and K 7. Mapping of N-ary Relationship Types For each n-ary relationship type R Create a new relation S to represent R include primary keys of participating entity types as foreign keys include any simple attributes as attributes

Vous aimerez peut-être aussi