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:aufgaben:a02 [2024/09/03 14:20] – vdemir | modul:m290:learningunits:lu04:aufgaben:a02 [2024/10/17 12:35] (aktuell) – vdemir | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== | + | ====== |
| ===== Requirements | ===== Requirements | ||
| Zeile 8: | Zeile 8: | ||
| * [[https:// | * [[https:// | ||
| * Expected result: Semantically and syntactically correct SQL statements according to the requirements of the case studies. | * Expected result: Semantically and syntactically correct SQL statements according to the requirements of the case studies. | ||
| - | |||
| ===== Case studies / Assignments ===== | ===== Case studies / Assignments ===== | ||
| Zeile 16: | Zeile 15: | ||
| ===== Assignments ===== | ===== Assignments ===== | ||
| - | You general assignment is to develop DQL commands that matches the requirements below: | + | The general assignment is to develop DQL commands that matches the requirements below: |
| - | * a) Supplier and PrWe need a list with product details as following: | + | ==== Assignment A ==== |
| - | * Supplier name | + | We need a list with product details as following: |
| - | * Supplier phone | + | * Name of the supplier |
| - | * ProductID | + | * Supplier phone |
| - | * ProductName | + | * Product ID |
| - | * Units | + | * Name of the product |
| - | * Price | + | * Units |
| - | * Ordered | + | * Price |
| + | The list must be be sorted | ||
| - | SELECT s.SupplierName, | ||
| - | FROM Suppliers s, Products p | ||
| - | WHERE p.SupplierID = s.SupplierID | ||
| - | ORDER BY s.SupplierName DESC; | ||
| - | * b) Extend the select, so that the list contains | + | ==== Assignment B ==== |
| - | * There are two possible solutions. | + | Extend the the result of the Select statement from assignment a), so that it must contain |
| - | * b1) The first one is to to search for the ID (SupplierID = 20) of the supplier and take that ID into our SELECT as follows: | + | |
| - | SELECT s.SupplierName, | + | ==== Assignment C ==== |
| - | | + | We would like to know what products the customer " |
| - | | + | |
| - | | + | |
| + | | ||
| + | * OrderDate | ||
| + | * Quantity | ||
| + | * ProductName | ||
| + | * CategoryName | ||
| - | * b2) The second solution take the name directly into the SELECT statemeng: | ||
| - | |||
| - | SELECT s.SupplierName, | ||
| - | FROM Suppliers s, Products p | ||
| - | WHERE p.SupplierID = s.SupplierID | ||
| - | AND s.SupplierName = 'Leka Trading'; | ||
| - | |||
| - | The result set is in both cases, as the figure below shows: | ||
| - | |||
| - | {{: | ||
| - | | ||
| - | * c) We would like to know what products the customer " | ||
| - | * c1) Like in assignment b) here a two approaches possible: 1. find the customerID (34) and select according to the customer id. | ||
| - | SELECT c.CustomerID, | ||
| - | FROM Customer c | ||
| - | | ||
| - | | ||
| - | | ||
| ===== Solution ===== | ===== Solution ===== | ||
| [[modul: | [[modul: | ||
| - | + | | |
| ===== Vocabulary ===== | ===== Vocabulary ===== | ||
| ^ English ^ German ^ | ^ English ^ German ^ | ||
| - | | respectively | + | | ... | ...| |
| - | | assignment | Auftrag | + | |
| ---- | ---- | ||
| [[https:// | [[https:// | ||