ERD MAKEN WAT IS EEN ERD Het entityrelationshipmodel

  • Slides: 14
Download presentation
ERD MAKEN

ERD MAKEN

WAT IS EEN ERD? Het entity-relationship-model of entity-relationship diagram (ERD) is een model of

WAT IS EEN ERD? Het entity-relationship-model of entity-relationship diagram (ERD) is een model of diagram voor het inzichtelijk te maken van een conceptueel datamodel Het is een visuele weergave van de entiteiten, relaties en regels die gelden of aanwezig zijn in een logisch ontwerp Het is een onderdeel van het ontwerpproces van een relationele database Een ERD bevat entiteiten, attributen en relaties Een ERD maak je – in de regel – van minimaal de derde normaalvorm of Wordt gebaseerd op een analyse en ontwerp

WAAROM EEN ERD? Het maken van een ERD heeft twee redenen: 1. De fysieke

WAAROM EEN ERD? Het maken van een ERD heeft twee redenen: 1. De fysieke inrichting van de database wordt er van afgeleid 2. Het geeft een functionele controle of alles gerealiseerd kan worden Een ERD is de vertaling van een functioneel ontwerp (of klassendiagram) naar de technische implementatie in een fysieke database (bv my. SQL)

VOORBEELD ERD

VOORBEELD ERD

NOTATIES BINNEN ERD

NOTATIES BINNEN ERD

ERD 101 Cardinaliteit: • Een Gene komt op één Chromosome voor • Een Chromosome

ERD 101 Cardinaliteit: • Een Gene komt op één Chromosome voor • Een Chromosome heeft nul of meer Gene’s

NORMALISEREN

NORMALISEREN

NORMALISEREN

NORMALISEREN

EERSTE NORMAALVORM

EERSTE NORMAALVORM

TWEEDE NORMAALVORM

TWEEDE NORMAALVORM

DERDE NORMAALVORM

DERDE NORMAALVORM

CHECKLIST ERD: DE 10 GEBODEN 1. PK voor elke entiteit bepaald? 2. FK’s bepaald?

CHECKLIST ERD: DE 10 GEBODEN 1. PK voor elke entiteit bepaald? 2. FK’s bepaald? 3. Zijn enitteiten verbonden? 4. Klopt de cardinaliteit? (oplezen!) 5. Zit er een ATAMHA in? 6. Zit er een onnodige slang in? 7. Kan ik de benodigde informatie opslaan? 8. Kan ik de benodigde informatie eruit halen? 9. Hoe ga ik de informatie tonen in de applicatie? (SQL!!!!) 10. Wat zegt mijn buurman er van? (SVP niet op toets of examen…. . )

DATABASESCHEMA Table Name: Semantics: Gene A gene, its attributes and a reference to the

DATABASESCHEMA Table Name: Semantics: Gene A gene, its attributes and a reference to the chromosome table. Column Type: Properties: Semantics: Name: PRIMARY KEY, Gene ID: INT Artificial key, no semantics outside of this database AUTOINCREMENT, NOT NULL Gene Name: VARCHAR(10) not NULL The common name of the gene Chromosom INT e ID: Foreign Key, references Chromosome References the Chromosome the gene is found on. Assumes a gene is found on exactly one Chromosome. Start INT not NULL Defines the first nucletodide (in chromosome coordinates) that is annotated as belonging to the gene. End INT not NULL Defines the last nucletodide (in chromosome coordinates) that is annotated as belonging to the gene. If End < Start, the gene is o the (-) strand.

DATABASESCHEMA 2 Table Name: Chromosome Semantics: A chromosome, some attributes, and its sequence. Column

DATABASESCHEMA 2 Table Name: Chromosome Semantics: A chromosome, some attributes, and its sequence. Column Name: Type: Properties: Chromosome ID: INT PRIMARY KEY, Artificial key, no semantics AUTOINCREMENT, NOT NULL outside of this database Chromosome Name: sequence VARCHAR(10) LONGTEXT Semantics: not NULL The number/letter of the chromosome. Not required to be unique. - Holds the (+) strand sequence. Sequence defines chromosome coordinates. Gaps are filled with the character "N".