Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
modul:m290:learningunits:lu07:aufgaben:03 [2024/10/01 10:47] – vdemir | modul:m290:learningunits:lu07:aufgaben:03 [2024/10/17 12:45] (aktuell) – vdemir | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== | + | ====== |
===== Requirements | ===== Requirements | ||
Zeile 11: | Zeile 11: | ||
In assignment A2 you imported 30 lines of date to the table ' | In assignment A2 you imported 30 lines of date to the table ' | ||
- | ==== A: Update with OR ==== | + | ==== A: Basic Update ==== |
+ | The employee ‘Laura Clark’ got divorced and therefore took her maiden name. Update her data record in the table. | ||
+ | |||
+ | ==== B: Update with OR ==== | ||
As a company policy the attribute ' | As a company policy the attribute ' | ||
- | UPDATE employees | + | ==== C: Update with AND ==== |
- | SET sex = '' | + | The performance of our company' |
- | WHERE sex = ' | + | |
- | + | ||
- | After performing the update statement, the select on the table ' | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | + | ||
- | ==== B: Update with AND ==== | + | |
- | The performance of our company' | + | |
- | + | ||
- | to make sure, that the outcome is correct we first need to find the rows concorned. The following SQL statements will give us the correct resultset. | + | |
- | + | ||
- | Select * | + | |
- | FROM employees | + | |
- | WHERE department = ' | + | |
- | AND salary < 70000; | + | |
- | + | ||
- | This execution of the select results in the following image: | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | After executing the following update command, we check the result, in which the 4 lines the ‘Salary’ column are now updated to CHF 70' | + | |
- | + | ||
- | UPDATE employees | + | |
- | SET salary = 70000 | + | |
- | WHERE department = ' | + | |
- | AND salary < 70000; | + | |
- | + | ||
- | Select * | + | |
- | FROM employees | + | |
- | WHERE department = ' | + | |
- | + | ||
- | {{: | + | |
===== Solution ===== | ===== Solution ===== | ||
- | [[modul: | + | [[modul: |
===== Vocabulary ===== | ===== Vocabulary ===== |