Relation between Sets AUFTRAG & KUNDE

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Relations Sets
Click For Summary
SUMMARY

The forum discussion centers on the mathematical relationships between two sets, AUFTRAG and KUNDE, defined by their respective attributes. The participants analyze operations such as union, intersection, and Cartesian product, concluding that the union of AUFTRAG and KUNDE is not valid due to incompatible column headers. They clarify that the intersection requires identical tuples, while the Cartesian product generates all possible combinations of tuples from both sets. The discussion emphasizes the importance of compatibility in set operations.

PREREQUISITES
  • Understanding of set theory operations: union, intersection, and Cartesian product.
  • Familiarity with relational database concepts, particularly relations and tuples.
  • Knowledge of mathematical notation for sets and relations.
  • Basic understanding of compatibility conditions for set operations.
NEXT STEPS
  • Study the properties of set operations in detail, focusing on union and intersection.
  • Learn about relational algebra and its application in database management systems.
  • Explore compatibility conditions for set operations in relational databases.
  • Investigate the implications of incompatible tuples in database queries and operations.
USEFUL FOR

Mathematicians, database administrators, data analysts, and students studying relational databases and set theory.

  • #61
mathmari said:
Do we maybe write :

Expression for 1 :
SELECT KUNDE.kundnr, KUNDE.ort
FROM KUNDE

That is effectively the same as before.

I think it might be:
SELECT k1.kundnr, k2.ort
FROM KUNDE k1, KUNDE k2
:unsure:


mathmari said:
So we need in these cases "DISTINCT", right?

In question 2, yes, we can expect that the same customer has multiple orders, so their name will get listed multiple times.
DISTINCT then ensures each name is listed only once. 🤔

In question 3 it is not be necessary. Orders are unique. So if we list the AUFTRAGNR's, we will already have at most one of each. 🤔


mathmari said:
Ah we have to write that this inequality holds for each a in AUTRAG, don't we?

Indeed. (Sweating)
 
Last edited:
Physics news on Phys.org
  • #62
Klaas van Aarsen said:
That is effectively the same as before.

I think it might be:
SELECT k1.kundnr, k2.ort
FROM KUNDE k1, KUNDE k2
:unsure:
So that we consider two different columns? :unsure:
Klaas van Aarsen said:
In question 2, yes, we can expect that the same customer has multiple orders, so their name will get listed multiple times.
DISTINCT then ensures each name is listed only once. 🤔

In question 3 it is not be necessary. Orders are unique. So if we list the AUFTRAGNR's, we will already have at most one of each. 🤔

Indeed. (Sweating)
So do we have to write the following ? Expression for 1 :
SELECT k1.kundnr, k2.ort
FROM KUNDE k1, KUNDE k2 Expression for 2 :
SELECT DISTINCT NAME
FROM KUNDE k, AUFTRAG a
WHERE k.KUNDNR = a.KUNDNRExpression for 3 :
SELECT DISTINCT AUFTRAGNR
FROM AUFTRAG a, KUNDE k
WHERE a.KUNDNR = k.KUNDNR AND (k.ORT = Gießen OR k.ORT = Wetzlar)Expression for 4 :
SELECT DISTINCT KUNDNR
FROM KUNDE k
WHERE k.KUNDNR != ALL
$ \ \ \ \ \ $(SELECT KUNDNR
$ \ \ \ \ \ $FROM AUFTRAG)
:unsure:
 
  • #63
Looks right to me. (Nod)
 

Similar threads

Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K