Top Banner
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI
16
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

ER to Relational TranslationCOMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI

Page 2: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

ER Diagrams

Entity

Relationship

Attributes

Page 3: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Some other symbols for ER-Diagrams

Multivalued attributes

Page 4: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Some other symbols for ER-Diagrams

Page 5: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Some other symbols for ER-Diagrams

Weak entity:◦ An entity that depends on another entity

Key attribute:o A key attribute is the unique, distinguishing characteristic of the entity

Page 6: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Some other symbols for ER-Diagrams

Multivalued attribute:A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values.

Derived attribute:A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary.

Page 7: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Some other symbols for ER-Diagrams

Composite attribute:◦ An attribute that has its own attributes.

Page 8: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Relationships in ER-Diagrams There are three types of relationships:

1. Binary relationship

2. Recursive relationship

3. Ternary relationship

Page 9: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Binary relationships◦ Relationship between two entities◦ Cardinality

◦ It has further 3 types:1. One to one relationship2. One to many relationship3. Many to many relationship

Page 10: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Binary relationships 1- One to one relationship

This relationship seems rare in this world

Page 11: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Binary relationships One to many relationship:

It reflects business rule in which one entity is related to many number of other entity.

Page 12: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Binary relationships Many to many relationship:

Many entities have relationship to many other entities

Page 13: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Recursive relationship

When an entity has relationship with its own.

Page 14: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Ternary relationship Relationship pf degree three is called ternary relationship

Page 15: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.

Participation Constraints in ER-Diagrams

Total Participation: Each entity in the entity is involved in the relationship. Total participation is represented by double lines.

Partial participation: Not all entities are involved in the relation ship. Partial participation is represented by single line.

Page 16: ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.