RDBMS SQL ClassNotes 22aug2024
RDBMS SQL ClassNotes 22aug2024
Madhavan Mukund
https://www.cmi.ac.in/~madhavan
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
The relational model — Edgar F Codd
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
The relational model — Edgar F Codd
-[S , XSzXSz
r = RXR XIR
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
The relational model — Edgar F Codd
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
The relational model — Edgar F Codd
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
The relational model — Edgar F Codd
Instructor
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 2 / 13
> to
All instructor names &
depts with salay
...
Relational algebra — select and project
!
department with salary above 90,000
Select rows that meet
-
some condition --
No (r-relation --X
I condition(Instructor
L
W
Physics'
dept name
salary >
=
9000
and
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 3 / 13
Relational algebra — select and project
j I Instructor)
depl: name :
"Physics
N
[
List instructors from Physics
department with salary above 90,000
List names of instructors
Tu
name
(* depl : name : Physics' (Inst)
Salary for
Can I?
we
swap - &
T-
deptia--
.
(name (Instructor)
salay
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 3 / 13
Relational algebra — select and project
dept
name
List names of instructors from Physics
-
department with salary above 90,000
~ salary
To no (r)
,
-- fat
details
Can ar
ri]] (r
,
i
Rm)
(rz , Re)
S XSz
,
i
(r Rm) ,
Relational algebra — join
Instructor ⇥ Teaches
-
-
oo
factor
s
name
sour to
21
Gu
Voter A IT
VoterName Dist
Chenna .
n
a
Per
O
says
-
match value
for same
"Natural"
join
r
,
a
r (no0)
Relational algebra — set operations
IPLIO2
,
1922024
Ur
Eli
removed
Duplicates y
# it
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 7 / 13
Relational algebra — set operations
V Or y
n M AND 1
To (r Tor (r)
vo(r) =
Er) Uro(r)
To, 102 (v) =
E, (r) n
To (r)
Madhavan Mukund RDBMS and SQL RDBMS-SQL, Lecture 2, 22 Aug 2024 7 / 13
Relational algebra — set operations
Relative
Not? T
Complement
that do not
Salify on