Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| modul:m290:learningunits:lu04:loesungen:l02 [2024/09/27 12:59] – vdemir | modul:m290:learningunits:lu04:loesungen:l02 [2024/10/17 12:35] (aktuell) – vdemir | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== | + | ====== |
| Zeile 23: | Zeile 23: | ||
| There are two possible solutions. | There are two possible solutions. | ||
| - | **b1)** | + | **B1)** |
| The first assignment is to search for the ID (SupplierID = 20) of the supplier and take that ID into our SELECT as follows: | The first assignment is to search for the ID (SupplierID = 20) of the supplier and take that ID into our SELECT as follows: | ||
| Zeile 31: | Zeile 31: | ||
| AND s.SupplierID = 20; | AND s.SupplierID = 20; | ||
| - | **b2)** | + | **B2)** |
| The second solution takes the name directly into the SELECT statement: | The second solution takes the name directly into the SELECT statement: | ||
| Zeile 38: | Zeile 38: | ||
| WHERE p.SupplierID = s.SupplierID | WHERE p.SupplierID = s.SupplierID | ||
| AND s.SupplierName = 'Leka Trading'; | AND s.SupplierName = 'Leka Trading'; | ||
| + | | ||
| The result set is in both cases, as the figure below shows: | The result set is in both cases, as the figure below shows: | ||
| Zeile 46: | Zeile 46: | ||
| We would like to know what products the customer " | We would like to know what products the customer " | ||
| - | **c1)** | + | **C1)** |
| Like in assignment b) here a two approaches possible: 1. find the customerID (34) and select according to the customer id. | Like in assignment b) here a two approaches possible: 1. find the customerID (34) and select according to the customer id. | ||
| Zeile 58: | Zeile 58: | ||
| ORDER BY od.Quantity; | ORDER BY od.Quantity; | ||
| - | **C1)** | + | **C2)** |
| - | The second approach, as in b2), is to filter the result set directly by customer name. | + | The second approach, as in B2), is to filter the result set directly by customer name. |
| SELECT c.CustomerID, | SELECT c.CustomerID, | ||
| Zeile 70: | Zeile 70: | ||
| ORDER BY od.Quantity; | ORDER BY od.Quantity; | ||
| | | ||
| - | | + | The result set is in both cases as shown in the following figure. |
| | | ||
| {{: | {{: | ||