100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Class notes Database Development £5.59   Add to cart

Lecture notes

Class notes Database Development

 2 views  0 purchase

The class notes is for learning material

Preview 2 out of 5  pages

  • April 22, 2023
  • 5
  • 2022/2023
  • Lecture notes
  • Junkin
  • All classes
All documents for this subject (4)
avatar-seller
kamranafridi
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller kamranafridi. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £5.59. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75323 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£5.59
  • (0)
  Add to cart