Relation between Sets AUFTRAG & KUNDE

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

Discussion Overview

The discussion revolves around the relationships between two sets, AUFTRAG and KUNDE, which represent different data structures. Participants explore the union, intersection, and Cartesian product of these sets, questioning the implications of their definitions and the nature of their elements.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • Some participants propose that AUFTRAG and KUNDE can be expressed as unions and intersections of their respective components, questioning the distinctiveness of elements in these operations.
  • There is uncertainty about the interpretation of tuples versus sets, with some participants suggesting that $(A_1, A_2, A_3)$ may represent a tuple of sets rather than a set of tuples.
  • Participants discuss the implications of the Cartesian product, suggesting that it involves matching each element of AUFTRAG with each element of KUNDE to form new tuples.
  • Some participants express confusion about how to handle elements that may not match across the two sets, particularly regarding the nature of the last components in the tuples.
  • There is a suggestion that the intersection of AUFTRAG and KUNDE would require exact matches of all components in the tuples, leading to the conclusion that no tuples from AUFTRAG exist in KUNDE.
  • Participants question the process of replacing elements in the resulting tuples from the Cartesian product with specific values, such as "Gießen".

Areas of Agreement / Disagreement

Participants generally agree on the definitions of union, intersection, and Cartesian product, but there remains disagreement and uncertainty regarding the interpretation of tuples, the distinctiveness of elements, and how to apply these operations correctly.

Contextual Notes

Some definitions and assumptions about the nature of the sets and their elements are not fully resolved, leading to varying interpretations of the operations discussed.

  • #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
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K