Data Manipulation Languages-Introduction to Database System-Lecture Slides, Slides of Introduction to Database Management Systems

This lecture was delivered by Dr. Tariq Mahmood at Quaid-i-Azam University for Introduction to Database System. It includes: Database, Systems, Relational, Algebra, Operations, Original, Intact, Operands, Results, Closure

Typology: Slides

2011/2012

Uploaded on 07/13/2012

shona.bacha
shona.bacha 🇵🇰

7 documents

1 / 67

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
In the name of ALLAH
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43

Partial preview of the text

Download Data Manipulation Languages-Introduction to Database System-Lecture Slides and more Slides Introduction to Database Management Systems in PDF only on Docsity!

In the name of ALLAH

Introduction to

Database Systems

Lecture

Spring 2012

Department of Computer Science

Relational Algebra

 Relational algebra operations

work on one or more relations

to define another relation

leaving the original intact.

Department of Computer Science

Relational Algebra

 Both operands and results are

relations, so output from one

operation can become input to

another operation.

Department of Computer Science

Relational Algebra

 5 basic operations in relational

algebra: Selection, Projection,

Cartesian product, Union, and

Set Difference.

Department of Computer Science

Relational Algebra

 These perform most of the data

retrieval operations needed.

 Also have Join, Intersection, and

Division operations, which can be

expressed in terms of 5 basic

operations.

Department of Computer Science

Select

 Selects tuples that satisfy a given

predicate

 Notation is Greek symbol sigma:

 PREDICATE ( RELATION)

Department of Computer Science

Select

 To process a selection,

– Look at each tuple

– See if we have a match (based on

the condition)

Department of Computer Science

Selection Example

stId stName stAdr prName curSem

S1020 Sohail Dar H#14, F/8- 4,Islamabad.

MCS 4

S1038 Shoaib Ali H#23, G/9- 1,Islamabad

BCS 3

S1015 Tahira Ejaz H#99, Lala Rukh Wah.

MCS 5

S1018 Arif Zia H#10, E-8, Islamabad.

BIT 5

Department of Computer Science

Selection Example

1. σ Curr_Sem > 3 (STUDENT)

2. σ Studid = „S1038‟ (STUDENT)

Department of Computer Science

Selection

Example Cont’d)

  1. σ (^) Salary > 27000 (FAC)
  2. σ(Salary>26000) or (Rank=„Asso Prof‟) (FAC)

Thanks

Department of Computer Sciencedocsity.com

Department of Computer Science

Projection

 Notation

 a1, a2, ..., ak (R)

where a 1 ... ak are attribute names and R

is a relation name

Department of Computer Science

Projection

 Works on a single relation R and

defines a relation that contains a

vertical subset of R, extracting

the values of specified attributes

and eliminating duplicates.