Title, Topic

Adat ERD, SQL, Normalisierung (Page 8).doc

®
Page 8 of 8
[1] [2] [3] [4] [5] [6] [7] [8]
Faculty
Information Science
Discipline
Information Technology / Computer Science
Document category
Notes
University, School
HTL Villach
Additional information
1997
Responsible User
This text has been add by user odom282 on 2008-10-03. Disclaimer
Popularity
731  visits
Document length
~7.432  Words
~42.216  Chars
Rating
Networking




















More documents
Information Technology / Computer Science

System und Einsatzplanung, TCP IP Protokoll
TCP/IP Allgemeines Protokolle sind die Regeln für den Nachrichtenaustaus­ch. Aufgaben eines Protokolls: · die Adressierung der Partner · die Fehlererkennung · die Fehlerbehebung · die Datenflußk

Probleme in Bezug auf Redundanz Lieferant und Stadt.

Insert: Lieferanten die nicht gerade ein Produkt liefern, können nicht gespeichert

werden. Würde zur Verletzung des Primary Keys führen.

Delete: Problem bezüglich der Löschsemantik. Wird eine Zeile gelöscht, verlieren wir

die Information, daß dieser Lieferant dieses Produkt nicht mehr liefert. Liefert

dieser Lieferant nur 1 Produkt verliert man alle Informationen über ihn.

Update Wenn der Lieferant seinen Standort wechselt, dann ist diese Information

Mehrmals zu ändern. (Gefahr der Inkonsistenz).

Ursachen des Problems

Relation befindet sich nicht in 2 Normalform

Definition der 2 Normalform

Eine Relation befi. sich in 2 Normalform wenn sie in 1 Normalform ist, und jedes Attribut das nicht Bestandteil des Primary Keys ist, irreduzibel von einem Schlüsselkandidaten abhängig ist.

Bzw. Jedes Nicht Schlüsselattribut ist nur vom gesamten Primary Key abhängig, und nicht nur von einem Teil.

Lösung:

Aufteilen der Tabelle.


P T1(P,L,M)

M

L


S T2(L,S,B)

L

B

Allgemein:

R(A,B,C,D)

PK A,B

Aà D

Aufteilen:

R1(A ,D)

Aà D

R2(A,B,C)

Foreign Key A references R1

AB ist Primary Key

Bemerkung:

Jede Relation deren Primary Key nur aus 1 Attribut aufgebaut ist befindet sich automatisch in 2 Normalform.

 

 

 

T2 (L,S,B)

This paragraph has been concealed!
Download the complete document for free!
Adat ERD, SQL, Normalisierung.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Bsp.:

L1 Wien 10

L2 Linz 20

L3 Wien 10

Problem

Insert: Die Information, daß eine bestimmte Stadt eine bestimmte Bewertung hat, ist ohne

Lieferanten in der Stadt nicht speicherbar.

Delete: Wird ein Lieferant gelöscht, kann auch die Information gelöscht werden, welche Stadt

welche Bewertung hat.

Update: Wird die Bewertung einer Stadt geändert, muß die Bewertung bei mehreren

geändert werden.

Ursache des Problems:

Relation befindet sich nicht in 3 Normalform

Eine Relation befindet sich in 3 Normalform, wenn sie in 2 Normalform ist, und jedes nicht-Schlüssel Attribut nicht transitiv von einem Schlüsselkandidaten abhängig ist.


L S B

Lösung

Aufteilen in 2 Tabellen

T1 (L,S)

T2 (S,B)

Allgemein:

T(A,B,C)

B à C

T1(A,B)

T2(B,C)

Anmerkung: Jede Relation ist nicht in 3 Normalform, bei der es neben den Abhängigkeiten zum Primary Key Abhängigkeiten zu anderen Attributen gibt.


Person PLZ


P# Ort

Person(P#,PLZ)

Ort(PLZ,Ort)

Boyce Codd Normalform

BCNF

Behandelt folgende Fälle:

1                    Es gibt zumindest 2 Schlüsselkandidaten in der Relation.

2                    Diese Schlüsselkandidaten sind zusammengesetzte Schlüssel.

3                    Diese Schlüsselkandidaten haben ein gemeinsames Element.

 

Bsp. für Punkt 1

L#,S,B, Name

L# ..eindeutig

Name ..eindeutig

This paragraph has been concealed!
Download the complete document for free!
Adat ERD, SQL, Normalisierung.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Diagramm:


L S


N B

Mehrere Schlüsselkandidaten in einer Relation sind kein Problem, es braucht keine Aufteilung erfolgen.

Information, daß N ein Schlüsselkandidat ist muß in der Datenbank berücksichtigt werden (UNIQUE)

Bsp.

L#,P,M, Name

L# Lieferantennummer :eindeutig

P Produkt

M Menge

Name :eindeutig


L M


P

N

Tabelle:

L,N,P,M

L1 P1 10 Meier

L1 P2 20 Meier

L1 P3 10 Meier

Redundanz !!!

Tabelle befindet sich in 3 Normalform aber nicht in Boyce Codd NF

Lösung: Aufteilen der Tabelle

T1 (L,N)

T2(L,P,M)

L ist gleichzeitig ein Fremdschlüssel

Lösung Test

{ABCD}

ABD -à E ABD enthalten

{ABCDE}

ABàG AB

{ABCDEG}

BàF B

{ABCDEFG}

CàJ C

{ABCDEFGJ}

CJàI CJ

{ABCDEFGJI}

GàH

{ABCDEFGHIJ}

ABCD = Superkey

Irreduzibel?

C Streichen

{ABD}

ABDàE ABD

{ABDE}

ABàG AB

{ABDEG}

BàF B

{ABDEFG}

CàJ C

{ABDGEF}

CJàI CJ

GàH G

{ABDGFEH}

ABD ist kein SK

A streichen

{BCD}

ABDàE ABD

ABàG AB

BàF F

{ABCDF}

CàJ C

{BCDFJ}

CJàI CJ

{BCDFJI}

GàH G

BCD kein SK

B streichen

{ACD}

ABDàF ABD

ABàG AB

CàJ C

CJàI

{ABCDIJ]

GàH

Kein SK

3)


Page 8 of 8
[1] [2] [3] [4] [5] [6] [7] [8]


swopdoc.com ist not responsible for the content of this text provided by third parties

Legal info - Copyright - Terms - Partner - Statistik - Contact
antiblock.org adblockdetector.com

Swap your documents