Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
faecher:informatik:oberstufe:datenbanken:normalisierung:1_normalform:start [26.11.2020 10:48] – [1. Normalform (1NF)] sbel | faecher:informatik:oberstufe:datenbanken:normalisierung:1_normalform:start [08.02.2024 07:45] (aktuell) – alte Version wiederhergestellt (08.02.2024 08:40) Frank Schiebel | ||
---|---|---|---|
Zeile 67: | Zeile 67: | ||
++++ Lösung Schritt 2 | | ++++ Lösung Schritt 2 | | ||
+ | <wrap hi> | ||
<code sql> | <code sql> | ||
UPDATE zahnarztbedarf SET plz = SUBSTRING_INDEX(TRIM(wohnort), | UPDATE zahnarztbedarf SET plz = SUBSTRING_INDEX(TRIM(wohnort), | ||
Zeile 72: | Zeile 73: | ||
</ | </ | ||
+ | ++++ | ||
+ | |||
+ | ++++ In einem (komplizierteren) Schritt | | ||
+ | Man kann das auch direkt machen, indem man die folgende Anweisung entsprechend für alle 4 Informationen anpasst: | ||
+ | <code sql> | ||
+ | UPDATE zahnarztbedarf SET ort=SUBSTRING_INDEX(TRIM(SUBSTRING_INDEX(adresse, | ||
+ | </ | ||
++++ | ++++ | ||
Zeile 80: | Zeile 88: | ||
++++ Lösung | | ++++ Lösung | | ||
- | 4 neue Tabellenfelder: | + | 4 neue Tabellenfelder: |
<code sql> | <code sql> | ||
Zeile 99: | Zeile 107: | ||
UPDATE zahnarztbedarf SET f_strasse = SUBSTRING_INDEX(SUBSTRING_INDEX(hersteller, | UPDATE zahnarztbedarf SET f_strasse = SUBSTRING_INDEX(SUBSTRING_INDEX(hersteller, | ||
UPDATE zahnarztbedarf SET f_ort = SUBSTRING_INDEX(hersteller, | UPDATE zahnarztbedarf SET f_ort = SUBSTRING_INDEX(hersteller, | ||
- | UPDATE zahnarztbedarf SET f_plz = SUBSTRING_INDEX(TRIM(ort), | + | UPDATE zahnarztbedarf SET f_plz = SUBSTRING_INDEX(TRIM(ort), |
- | UPDATE zahnarztbedarf SET f_ort = SUBSTRING_INDEX(TRIM(ort), | + | UPDATE zahnarztbedarf SET f_ort = SUBSTRING_INDEX(TRIM(ort), |
</ | </ | ||