Download Relational Databases-Lecture 04 Slides-Computer Science and more Slides Relational Database Management Systems (RDBMS) in PDF only on Docsity!
Relational Databases - Comp2400 / Comp
Lecture 5: Sets, Products, Relations, Functions
Maths is more than numbers
The mathematical ideas that relational databases are built on.
Sets, indexed sets
Products
(a more general definition than the usual one)
Relations
Functions
This will prepare us for some relational algebra, and
normalisation, which is largely about “functional dependencies”.
a set is several things considered together as one thing
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London }
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {}
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {} {{ 1 }, { 1 , 2 }, { 1 , 2 , 3 }, ...}
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {} {{ 1 }, { 1 , 2 }, { 1 , 2 , 3 }, ...}
2 describe its members using a property (or “constraint”)
{ the wheels on Greg’s car }
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {} {{ 1 }, { 1 , 2 }, { 1 , 2 , 3 }, ...}
2 describe its members using a property (or “constraint”)
{ the wheels on Greg’s car } { students currently enrolled in Comp6240 }
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {} {{ 1 }, { 1 , 2 }, { 1 , 2 , 3 }, ...}
2 describe its members using a property (or “constraint”)
{ the wheels on Greg’s car } { students currently enrolled in Comp6240 } { goldfish currently enrolled in Comp6240 } { the finite sets of integers }
a set is several things considered together as one thing
there are two ways of specifying a set:
1 list the items in it
{ Sydney , Toulouse , London } { 2 , 3 , 15 , 328 } {} {{ 1 }, { 1 , 2 }, { 1 , 2 , 3 }, ...}
2 describe its members using a property (or “constraint”)
{ the wheels on Greg’s car } { students currently enrolled in Comp6240 } { goldfish currently enrolled in Comp6240 } { the finite sets of integers }
a set’s members have no order: { 1 , 2 } = { 2 , 1 }
Set operations and relations
membership we write x ∈ { x , y , z } to say that x is in the set
Set operations and relations
membership we write x ∈ { x , y , z } to say that x is in the set
subset if every member of A is also in B we write A ⊆ B
Set operations and relations
membership we write x ∈ { x , y , z } to say that x is in the set
subset if every member of A is also in B we write A ⊆ B
equality two sets are equal if they have the same members
union we write A ∪ B for the set containing everything in
A and everything in B
Set operations and relations
membership we write x ∈ { x , y , z } to say that x is in the set
subset if every member of A is also in B we write A ⊆ B
equality two sets are equal if they have the same members
union we write A ∪ B for the set containing everything in
A and everything in B
intersection we write A ∩ B for the set of things that are in both
A and B