Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Mapping and Binary Relationships - Database Management - Lecture Slides, Slides of Introduction to Database Management Systems

Mapping Relationships, Binary Relationships, Minimum Cardinality, Binary one to one, Unary Relationships, Subtype Relationship, Relational Algebra are the main points of this lecture.

Typology: Slides

2011/2012

Uploaded on 11/03/2012

dharmaraaj
dharmaraaj 🇮🇳

4.4

(65)

153 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Database
Management
System
Lecture - 16
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Mapping and Binary Relationships - Database Management - Lecture Slides and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database

Management

System

Lecture - 16

Mapping Relationships

Relationships are mapped

according to their degree and cardinalities

Starting from binary relationships

One to Many Example

EMP PROJ

EMP(empId, empName, projId) PROJ(projId, projName, projDur, projCost)

Minimum Cardinality

Minimum cardinality on one side

needs special attention

If optional, define FK as normal

If compulsory, make FK not null

Many to Many Relationship

A third table is created for the relationship, sometimes also called associative entity type Generally, the PKs of the participating ETs are used as PK of the third table

Many to Many

Relationship Example

BOOK STD

stId sName

sFname

bkId bkTitle

bkAuth

isDate

rtDate

STD(stId, sName, sFname) BOOK(bkId, bkTitle, bkAuth) TARNS(bkId, stId, isDate, rtDate)

bkId stId

Binary one to one

A special form of one to many relationship

PK of one ET has to be included in the other as FK.

Normally PK of compulsory side is included in the optional side

Unary Relationships

Unary one to many introduces the PK of same ET as FK

Many to many unary requires creation of another relation with a composite PK

Unary Example

EMP

manages

empName^ empId

eQual

EMP(empId, empName, eQual, empId)

Unary Example

ITEM

has

iName itemNo

uCost Qty

ITEM(itemNo, iName, uCost) COMPONENT(itemNo, CompNo, Qty)Docsity.com

Super/Subtype Relationship

Separate relations are created for each of the supertype and subtypes Assign relevant attributes Primary key of the supertype is included in all relations, that work for both the identity and the link

Summary of Mapping E-R

Diagram to Relational DM

DATA

MANIPULATION

LANGUAGES