Logický návrh
Logicky navrh I.
Plán na cvičenie
- Vytvorenie relacie
- Generalizacia
- Urcenie primarnych klucov
- Dekompozicia M:N vztahov
- Urcenie cudzich klucov
Vytvorenie relacie
Vytvorte z nasledovneho ERA diagramu relacie.
Generalizacia vztahov
Zamyslite sa nad vytvorenymi relaciami ci medzi nie je mozne znazornit generalizaciu.
Urcenie primarnych klucov
Urcite primarne kluce pre vytvorene relacie z predchadzajuceho ERA diagramu.
Vztahy z konceptualneho navrhu
Urcenie primarnych klucov
Best Practices
Pri vybere primarneho kluca je vhodne sa riadit tymito pravidlami :
- Primary keys should be as small as necessary. Prefer a numeric type because numeric types are stored in a much more compact format than character formats. This is because most primary keys will be foreign keys in another table as well as used in multiple indexes. The smaller your key, the smaller the index, the less pages in the cache you will use.
- Primary keys should never change. Updating a primary key should always be out of the question. This is because it is most likely to be used in multiple indexes and used as a foreign key. Updating a single primary key could cause of ripple effect of changes.
- Do NOT use "your problem primary key" as your logic model primary key. For example passport number, social security number, or employee contract number as these "primary key" can change for real world situations.
Natural vs. Surrogate keys rules
Dekompozicia M:N vztahov
Pred dekompoziciou M:N vztah
Po dekompozicii vztahu M:N na vztah 1:N
Urcenie cudzich klucov
Výsledok návrhu
Alternatívna návrhu 1
Na stiahnutie PDF: Logicky navrh - zadanie
Alternatívna návrhu 2
Na stiahnutie PDF: Logicky navrh - zadanie