Design-Tools-ERD - VCE IT Lecture Notes by Mark Kelly

advertisement
VCE IT Theory Slideshows - ITA
Entity Relationship Diagrams
(ERD)
By Mark Kelly
mark@vceit.com
Vceit.com
This is the VCAA sample ERD,
published at
http://www.vcaa.vic.edu.au/vcaa/v
ce/studies/infotech/itapplications/publications/IT-Appssamp.pdf
RELATIONSHIP
RELATIONSHIP
RELATIONSHIP
KEY FIELD
In the real world,
primary field
names are often
underlined.
Reading the ERD
A Teacher
Reading the ERD
supervises
Reading the ERD
subjects
Reading the ERD
Each subject has a name
attribute
Reading the ERD
Reading the ERD
Reading the ERD
But …
• The VCAA sample ERD has NO CARDINALITY
• i.e.no indications of
– 1:1
– 1:many
– many:1
– many:many relationships
We have to assume…
No cardinality is shown. Can one teacher
supervise more than one subject or class?
We have to assume…
Can one subject or class be supervised by
more than teacher?
This ERD does not say. Use the case study
and common sense.
Unofficial additions…
N 
1
The ‘many’ end of a relationship can be
shown as “N” or “” …
Unofficial additions…
“Crow’s feet” notation of
“many”
“Crow’s feet” notation of “1”
Optional Advanced Crowsfeet
If we wished to indicate that a school may enrol
many students, or may not enrol any students at
all. We also wish to indicate that each student
attends exactly one school. This diagram
indicates this optionality and cardinality:
Each school enrolls
STUDENT
Each student attends
at least zero
at least one
and at most many
and at most one
students
SCHOOL
school
The VCAA sample exam question
List the three basic elements of entity relationship diagrams and
provide an example of each from the diagram. (3 marks)
The answer
RELATIONSHIP
KEY FIELD
VCE IT THEORY SLIDESHOWS
By Mark Kelly
mark@vceit.com
vceit.com
These slideshows may be freely used, modified or distributed by teachers and students
anywhere on the planet (but not elsewhere).
They may NOT be sold.
They must NOT be redistributed if you modify them.
Download