October 10, 2005
- Dr. Peter R Gillett
1
A.I.S. Class 10: Outline I REA Ontology I Learning Objectives for - - PowerPoint PPT Presentation
A.I.S. Class 10: Outline I REA Ontology I Learning Objectives for Chapter 9 I Designing the Data Repository Structure I Event-Oriented Modeling I Database Normalization I Group Work for Chapter 9 I Classroom Assessment I CLASSROOM PRESENTATION 2
October 10, 2005
1
October 10, 2005
2
October 10, 2005
3
N convert an extended entity relationship diagram to
N articulate the conversion rules for mandatory
N articulate the conversion rules for optional
N explain the concept of database normalization
October 10, 2005
4
N describe the rules for determining whether a table
N explain the process of implementing tables in a
N explain how forms in a relational database
October 10, 2005
5
October 10, 2005
6
I Every entity in the REA model will require a table with a
I So there should normally be a table for every:
resource event agent
I Additional tables may be required to model certain types
I Finally, tables may be required for reference purposes
October 10, 2005
7
October 10, 2005
8
collapse the two entities into a single table
post the primary key of either table as a foreign key in
post the primary key for the ‘1’ table as a foreign key
create a new Link Table with the primary keys from
October 10, 2005
9
For optional entities
N always treat as if their cardinality were M N i.e., treat both 0 .. 1 and 0 .. * entities as 0 .. *
When modeling two events linked 1:1
N post the key of the first event as a foreign key in the table for
When modeling two events linked1:M where the ‘1’
N treat the link as a M:M link - i.e., create an additional Link
the chapter – because the second of two related events is almost always optional in the relationship with the first, and so is in any case treated as many
October 10, 2005
10
October 10, 2005
11
I Proposal-Scientist ([Proposal#], [Scientist#]) I Proposal-EquipmentRequested ([Proposal#], [Equipment#]) I Proposal-ChemicalsRequested ([Proposal#], [Chemical#], Quantity,
I Proposal-EquipmentUsed ([Proposal#], [Equipment#]) I Proposal-ChemicalsUsed ([Proposal#], [Chemical#], Quantity,
I No reference tables needed I Consider:
October 10, 2005
12
October 10, 2005
13
I Storing Balances
Technically wrong Sometimes still done for convenience Imposes extra processing burden to ensure correct
I Recording agents: customers/vendors
Can you be certain who you shipped to and who you paid? Omit if you can For now (and the Mid-Term!) assume not! . . .
I Inventory
Are items uniquely identified (like cars) or not (like books)
I Cash as a resource
Cash account numbers
October 10, 2005
14
October 10, 2005
15
October 10, 2005
16
N inability to add certain data
N deleting data in one place causes a loss of other
N changes must be made in multiple locations
October 10, 2005
17
October 10, 2005
18
N Functional dependencies not originating from the
N Functionally dependent on values in other tables
October 10, 2005
19
October 10, 2005
20
October 10, 2005
21
October 10, 2005
22
This is unnormalized data because of the recurring
Value and Total should not be stored because they
October 10, 2005
23
These tables are 1NF The Invoice table is 2NF but not 3NF because
Salesman names and Item descriptions are
On the Invoice-Line table Price is not determined
October 10, 2005
24
But now the final table is not 2NF because Price
October 10, 2005
25
October 10, 2005
26
October 10, 2005
27
October 10, 2005
28
October 10, 2005
29