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

Database Management System Lecture 8: Keys and Relationships in ER Data Model, Slides of Introduction to Database Management Systems

A part of a database management system lecture series on docsity.com. It covers the concepts of keys, their different types including super keys, candidate keys, and primary keys, as well as the difference between simple and composite keys. The document also explains the need for keys and the concept of relationships in the er data model.

Typology: Slides

2011/2012

Uploaded on 11/03/2012

dharmaraaj
dharmaraaj 🇮🇳

4.4

(65)

153 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Database
Management
System
Lecture - 8
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Database Management System Lecture 8: Keys and Relationships in ER Data Model and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database

Management

System

Lecture - 8

Today’s Overview

Key and its different types

Relationships in E-R Data

Model

Types of relationships

Example of Key

StdId StdName Address ClName CurSem

S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6

Simple or Composite Key

A key consisting of single attribute is

called simple key, e.g., StudID, itemNo

A key consisting of more than one

attribute is known as composite key ,

like {Program_Code,Course_Code}

Super Key Definition same as of key For example, for EMPLOYEE and STUDENT entity types EmpID and StudID are the superkeys respectively.

Composite Key Example

StdId StdName Address ClName CurSem

S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6

Super Keys

StdId StdName Address ClName CurSem

S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6

Candidate Key A candidate key is the super key that does not contain extra attributes. It might have more than one attribute that uniquely identifies an entity. e.g {name, address}

CK Example

StdId StdName Address ClName CurSem

S1020 Suhail Dar Mareer Hassan MCS 4 S1038 Shoaib Baber Model Town BCS 3 S1015 Tahira Ejaz Wah Cantt MCS 2 S1018 Arif Mehmood Satellite Town BIT 4 S1025 Suhail Shah Garhi Shahoo BCS 6

Primary Key

A primary key is the main/chosen

candidate key from the possible

set of candidate keys that is most

suitable for entity identification.

Primary Key

The other candidate keys called

Alternate keys provide another

method of accessing records.

Need for Key

Need for unique identification

and access

Secondary Keys: We access

on something not necessarily

unique