mathmari
Gold Member
MHB
- 4,984
- 7
Create an expression for the below in the domain relational calculus and and an expression in the tuple calculus.
1. Create an expression that lists all possible combinations of customer numbers (KUNDNR) and locations (ORT).
2. Create an expression that lists all customer names (NAME) with at least one order (Auftrag).
3. Create an expression that lists all order numbers (AUFTRAGNR) with customers from Gießen or Wetzlar.
4. Create an expression that lists all customer numbers (KUNDNR) without an order (Auftrag).
5. Create an expression that lists all customer numbers (KUNDNR) that are not assigned to any order (Auftrag) and all customer numbers (KUNDNR) to which no name (NAME) is assigned.
Let's start with the first two (Malthe)
1 : We have written this with the expression $\pi_{\text{KUNDNR}, \text{ORT}}(\text{KUNDE})$ which can be written in relational calculus with the expression $\{y_1, y_2\mid \exists x_1, x_2, x_3\left (\text{KUNDE}(x_1, x_2, x_3)\land y_1=x_1\land y_2=x_3\right \}$, right? :unsure:
2 : We have written this with the expression $\pi_{\text{NAME}}(\text{KUNDE} \ltimes \text{AUFTRAG})$ which can be written in relational calculus with the expression $\{y \mid \exists x_1, x_2, x_3\left (\text{KUNDE} \ltimes \text{AUFTRAG}(x_1, x_2, x_3)\land y_1=x_1\land y_2=x_3\right \}$, right? Now we have to write also the left join in relational calculus, or not? :unsure:
1. Create an expression that lists all possible combinations of customer numbers (KUNDNR) and locations (ORT).
2. Create an expression that lists all customer names (NAME) with at least one order (Auftrag).
3. Create an expression that lists all order numbers (AUFTRAGNR) with customers from Gießen or Wetzlar.
4. Create an expression that lists all customer numbers (KUNDNR) without an order (Auftrag).
5. Create an expression that lists all customer numbers (KUNDNR) that are not assigned to any order (Auftrag) and all customer numbers (KUNDNR) to which no name (NAME) is assigned.
Let's start with the first two (Malthe)
1 : We have written this with the expression $\pi_{\text{KUNDNR}, \text{ORT}}(\text{KUNDE})$ which can be written in relational calculus with the expression $\{y_1, y_2\mid \exists x_1, x_2, x_3\left (\text{KUNDE}(x_1, x_2, x_3)\land y_1=x_1\land y_2=x_3\right \}$, right? :unsure:
2 : We have written this with the expression $\pi_{\text{NAME}}(\text{KUNDE} \ltimes \text{AUFTRAG})$ which can be written in relational calculus with the expression $\{y \mid \exists x_1, x_2, x_3\left (\text{KUNDE} \ltimes \text{AUFTRAG}(x_1, x_2, x_3)\land y_1=x_1\land y_2=x_3\right \}$, right? Now we have to write also the left join in relational calculus, or not? :unsure: