100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Lecture notes

Class notes Database Development

Rating
-
Sold
-
Pages
5
Uploaded on
22-04-2023
Written in
2022/2023

The class notes is for learning material










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
April 22, 2023
Number of pages
5
Written in
2022/2023
Type
Lecture notes
Professor(s)
Junkin
Contains
All classes

Subjects

Content preview

Appendix 1

1. Mathematical Relations
 Assume we have two sets D1 and D2 where D1 = {2, 4} and D2 {1,3,5}
 Cartesian Product:


D1 X D2 = {(2,1), (2,3), (2,5), (4, 1), (4,3), (4,5)}


 Any subset of the Cartesian product is a relation. e.g.


R1 = {(2,1), (4,3)}
D1 D2
2,4 1,
35


2 1

4 3



 Extend the notion of a relation to three sets
D1 = {1,3} D2 = {2,4} D3 = {5,6}


 Cartesian Product
D1 X D2 X D3 = {(1,2,5),(1,2,6),(1,4,5),(1,4,6),(3,2,5),(3,2,6),(3,4,5),(3,4,6)}
 Any subset of the Cartesian product is a relation. e.g.

R2 = {(1,2,6), (3,4,5)} D3
D2
D1 1, 2, 5,
3 4 6

1 2 6


3 4 5



Therefore given domains D1, D2, ..... Dn a relation is a set of n-tuples each of which has its
first element from D1, its second element from D2, its third element form D3, and it nth
element from Dn.
1

, n-tuple – a tuple with n values.

2. Database Relations
Applying the above concepts to databases, a relation schema can be defined as:

A named relation defined by a set of attribute and domain pairs.


Let A1, A2, A3, .... An be attributes with domains D1, D2, D3, .... Dn. Then the set:

{A1:D1, A2:D2, A3:D3, ..... An:Dn } is a relation schema.


Thus a relation R on this schema is a set of n-tuples. Each element in the n-tuple
consists of an attribute and a value of that attribute.




D1 D2 D3 Dn
d11, d12, d21, d22, d31, d32, ......... dn1, dn2,
d13, d23, etc. d33, dn3, etc.
.
etc. etc.


A1:d1 A2:d21 A3:d31 ......... An:dn1


A1:d12 A2:d22 A3:d32 ........ An:dn2


A1:d13 A2:d23 A3:d33 ....... An:dn3




2
£5.88
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
kamranafridi

Get to know the seller

Seller avatar
kamranafridi University of the West of Scotland
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions